fix: stop polling activity logs after an auth error - #680
Merged
Merged
Conversation
Tailing activity logs with `slack activity --tail` or `slack run` now returns when the activity API responds with invalid_auth, not_authed, token_expired, or token_revoked instead of polling again every few seconds until the idle timeout.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #680 +/- ##
==========================================
+ Coverage 78.22% 78.23% +0.01%
==========================================
Files 239 239
Lines 18144 18149 +5
==========================================
+ Hits 14193 14199 +6
+ Misses 3951 3950 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
mwbrooks
marked this pull request as ready for review
September 29, 2026 18:32
srtaalej
approved these changes
Sep 29, 2026
srtaalej
left a comment
Contributor
There was a problem hiding this comment.
thank you for quick followups!
Member
Author
|
Thanks a lot for the second pair of eyes @srtaalej! 🙇🏻 |
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.
Changelog
Fixed an issue where
slack activity --tailandslack runkept requesting activity logs every few seconds after the login token became invalid. The command now exits with the auth error.Summary
This pull request stops activity log polling when the activity API returns an auth error.
apps.activities.listerrors were logged at debug level and retried on every tick (3 seconds by default) until the idle timeout. Forslack run, the idle timeout is 24 hours.invalid_auth,not_authed,token_expired, andtoken_revokednow return the error and stop polling, because every later request with the same token would fail too.This is a follow-up to #679, which stops retrying token rotation with an invalid refresh token. The two changes are independent and can merge in either order.
Preview
Testing
slack activity --tailfor an app.slack logoutfor that workspace.slack activity --tailexits with an auth error on the next poll instead of continuing to poll.slack runand confirm it exits with the auth error.Notes
slack run, an auth error from activity polling now ends the run session, which is consistent with how other errors from the run goroutines are handled.Requirements