chore: ads/sdk resilience fixes#1
Merged
Sytten merged 4 commits intocaido-community:mainfrom Apr 12, 2026
Merged
Conversation
- Add default branches to match statements in CloudUserError, PluginUserError, StoreUserError, and ProjectUserError so new server-side enum variants don't leave error objects half-constructed - Add auth retry to GraphQL client: detect authorization errors and refresh token + retry once, matching existing REST client behavior - Set default 30s timeout on GraphQL HTTP and WebSocket transports (previously None, causing indefinite hangs on unreachable instances) - Fix to_user_error() to preserve error classification when server returns recognized codes with unknown reasons, instead of silently discarding the error type Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
42 tests covering all four fixes: - Error default branches: known variants still work, unknown variants produce valid errors instead of half-constructed objects - to_user_error() fallthrough: recognized codes with unknown reasons preserve error classification, unrecognized codes still return None - GraphQL auth retry: retries once on auth error then raises, does not retry on non-auth errors, does not loop infinitely - GraphQL timeouts: default 30s applied, sub-second values not truncated, timeout propagated to both HTTP and WebSocket transports Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.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.
<3 you guys big time for this
tldr of proposed changes
was writing some automation scripts against my caido instance and ran into a few issues:
AuthorizationUserErrorwhile rest calls silently recovered — turns out the graphql client had no auth retry logic even thoughhas_authorization_error()was already written and unusedNone)AttributeError: 'CloudUserError' object has no attribute 'reason'— the error match statements had no default branch so new server-side enum variants left error objects half-constructedto_user_error()was returningNonefor recognized caido error codes with unknown reasons, silently dropping the error classificationchanges
case _:default branches toCloudUserError,PluginUserError,StoreUserError,ProjectUserErrormatch statements_execute(), matching the existing rest client pattern500mswas becoming0s)to_user_error()now returns a typed error instead ofNonewhen it sees a recognized code with an unknown reasontesting
added 42 unit tests across 4 test files — all passing:
ran
ruff format,ruff check --select I, andty check— no new issuestyia!