fix(slack-app): retry slack rate limits when fetching thread messages#60983
Merged
Conversation
fe5d04c to
9207854
Compare
conversations.replies is a Tier-3 rate-limited Slack method. Under bursty usage it returns HTTP 429, which the SDK raised as a fatal SlackApiError that bubbled up to the @PostHog mention workflow's catch-all and surfaced to users as a generic internal error. Register slack_sdk's RateLimitErrorRetryHandler so the SDK honors Retry-After and retries transparently inside the activity.
9207854 to
592d9b1
Compare
VojtechBartos
approved these changes
Jun 1, 2026
Contributor
Prompt To Fix All With AIFix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
products/slack_app/backend/tests/test_collect_thread_messages.py:342
The test confirms a `RateLimitErrorRetryHandler` is registered but doesn't assert `max_retry_count=3`. Changing that value in the production code would pass this test silently. Checking the specific handler attribute costs one line and pins the contract.
```suggestion
handlers = [h for h in self.slack.client.retry_handlers if isinstance(h, RateLimitErrorRetryHandler)]
assert len(handlers) == 1
assert handlers[0].max_retry_count == 3
```
Reviews (1): Last reviewed commit: "fix(slack-app): retry slack rate limits ..." | Re-trigger Greptile |
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
under bursty usage Slack returns HTTP 429. The SDK raised this as a fatal
SlackApiError, which propagated up to the mention workflow's top-levelexcept Exceptioncatch-all and was shown to the user as the generic error.Changes
RateLimitErrorRetryHandlerregistered. On a 429 the SDK honors Slack'sRetry-Afterheader and retries transparently (up to 3 times) instead of surfacing a fatal error.