Repository navigation
fix(mastodon): skip a run when the instance returns a 5xx - #226
Merged
Merged
Conversation
mastodon.social answered 503 for a few minutes on 2026-10-20 and both Mastodon functions failed, which tripped the Lambda Errors alarm. Treat server errors like timeouts: the next run picks up from the cursor. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GNvt1QTR2gkHnre3WTdrcK
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.
Requested by lens0021 · project thread
Before: when mastodon.social answers with a 5xx,
mastodon-discordandmastodon-boostfail the invocation. On 2026-10-20 between 07:13Z and 07:20Z it returned 503 Service Unavailable, giving 5 + 3 errors (MastodonServiceUnavailableErrorfromGET /api/v1/notifications) and tripping the "Lambda Errors" alarm.After: a 5xx is handled like a timeout (#220): the run is skipped with a log line and the next run picks up from the cursor.
How: catch
MastodonServerError(500/502/503/504) next toMastodonNetworkErrorin both handlers, with a test each. The cursor is only written per handled mention, so nothing is lost.Generated by Claude Code