Skip to content

Handle GitHub App token revoke timeouts without failing requests#82

Draft
cursor[bot] wants to merge 1 commit intomainfrom
cursor/sentry-error-investigation-9bb2
Draft

Handle GitHub App token revoke timeouts without failing requests#82
cursor[bot] wants to merge 1 commit intomainfrom
cursor/sentry-error-investigation-9bb2

Conversation

@cursor
Copy link
Copy Markdown

@cursor cursor Bot commented Apr 19, 2026

Summary

  • make GitHub App installation token revocation best-effort in GithubAppToken.get_token
  • add an explicit timeout to token revocation requests to avoid hanging network calls
  • catch and log revocation network errors so cleanup failures do not mask the original request flow
  • add focused tests for successful revocation, revoke timeout handling, and preserving original exceptions

Root cause

Sentry issue SENTRY-GITHUB-ACTIONS-APP-6V showed ConnectTimeout raised from the finally block in token cleanup (requests.delete), which could bubble out of request handling and replace the true upstream error context. This happened when GitHub API connectivity was degraded during cleanup.

Validation

  • ~/.local/bin/pytest -q tests/test_github_app.py tests/test_web_app_handler.py tests/test_sentry_config_file.py
  • all tests passed (1 pre-existing skipped test)
Open in Web View Automation 

Co-authored-by: Armen Zambrano G. <armenzg@users.noreply.github.com>
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