Skip to content

fix(auth): stop polling failed authorizations - #157

Draft
Kayvan-Zahiri wants to merge 1 commit into
ArcadeAI:mainfrom
Kayvan-Zahiri:codex/stop-auth-polling-on-failure
Draft

Kayvan-Zahiri wants to merge 1 commit into
ArcadeAI:mainfrom
Kayvan-Zahiri:codex/stop-auth-polling-on-failure

Conversation

@Kayvan-Zahiri

Copy link
Copy Markdown

client.auth.wait_for_completion() keeps polling when authorization reaches failed, even though AuthorizationResponse.status lists it as a terminal outcome. A failed response passed directly to the helper also triggers more requests. The async helper behaves identically.

Stop polling on either completed or failed and return the terminal AuthorizationResponse, allowing callers to inspect its status. Document the return behavior on both methods. Pending/not-started polling and the existing missing-ID validation remain intact.

Validation:

  • 14 new cases use the public sync/async clients and real HTTPX MockTransport responses. They cover failed/completed input objects, direct IDs, and pending-to-terminal transitions. The transport rejects any request after the expected terminal response so the original infinite polling fails deterministically.
  • Before: 8 failed, 6 passed. After: all 14 new and all 6 existing auth-wait tests pass.
  • Non-API-resource suite: 405 passed, 2 skipped. The existing auth-wait tests were run separately because they live under api_resources; other generated endpoint tests need a mock API server.
  • Repository-wide Ruff lint, changed-file formatting, and git diff --check pass.
  • No live Arcade credentials, authorization, or cloud resources used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant