fix: override rate limit retry to 60s for per-user API calls - #86
Conversation
Slack's Retry-After header returns 4s for users.info 429s, but the endpoint has a rolling window of ~100 req/min. Waiting only 4s recovers enough quota for 1-2 requests before hitting the limit again, causing an infinite retry loop that never makes progress. When WrapError detects a rate limit error (via IsRateLimited check on the annotations), override the annotation to 60s so the SDK waits long enough for the rolling window to fully reset. Applied to both the usergroup grants per-member loop and SCIM user listing per-user loop. Also removes double-wrapping of errors in scimUserResource — the caller in listScimAPI now handles WrapError. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Claude finished @btipling's task in 1m 6s —— View job PR Review: fix: override rate limit retry to 60s for per-user API calls
Overall: This PR looks good. The approach is sound — Slack's What I like
Suggestions
No issues found
LGTM — this is a clean, focused fix. |
Summary
users.inforeturns a 429, overrides the rate limit annotation to 60s instead of Slack'sRetry-After: 4sIsRateLimited)IsRateLimitedandRateLimitOverridehelpers with testsContext
Resolves CXH-1301
Slack's
users.infoRetry-After header returns 4s, but the endpoint has a rolling window of ~100 req/min. Waiting only 4s recovers enough quota for 1-2 requests before hitting the limit again, causing an infinite retry loop. 60s lets the window fully reset.Test plan
go test ./pkg/connector/client/ -v🤖 Generated with Claude Code