René's URL Explorer Experiment


Title: fix(#210): replayed or cookie-less OAuth callbacks redirect home instead of 500 by sspickle · Pull Request #211 · vpython/glowscript · GitHub

Open Graph Title: fix(#210): replayed or cookie-less OAuth callbacks redirect home instead of 500 by sspickle · Pull Request #211 · vpython/glowscript

X Title: fix(#210): replayed or cookie-less OAuth callbacks redirect home instead of 500 by sspickle · Pull Request #211 · vpython/glowscript

Description: Fixes #210. What /google/auth catches OAuthError (the base of MismatchingStateError, also covering a replayed code's invalid_grant) and redirects to / — the only place a user whose callback can never succeed can actually do something useful. The no-state branch ("Yikes!") now redirects too instead of falling through to a guaranteed crash. Why redirect rather than an error page The state is single-use by design (CSRF protection — untouched here). Once it's consumed or the cookie never existed, retrying the same URL cannot work; the only recovery is starting a fresh sign-in from the landing page. A bare 500 invites exactly the wrong response — refresh — which is how one classroom machine produced 68 consecutive failures on 2026-09-01. Testing tests/test_auth_callback.py reproduces the exact production exception (RED on master: MismatchingStateError: mismatching_state: CSRF Warning!) and pins the redirect for both the replay shape and the bare-URL shape. Suite run under python:3.12 (matching the GAE runtime, since a 3.13 venv can no longer import the app — cgi was removed): 21 passed, 2 failed — both failures pre-exist on master in test_plotusers and are unrelated (verified by running master in the same container). Production data Steady 1–2% of sign-ins have failed this way for as far back as retention reaches, across a July-15 deploy boundary and a 6× traffic change — full numbers in #210. Update 2026-09-06: a third failure population, reported by a user Bruce forwarded two Error Reporting alerts from the production glowscript project. They are one event: http.client.RemoteDisconnected and urllib3.exceptions.ProtocolError: ('Connection aborted.', RemoteDisconnected(...)) — the second is requests wrapping the first, and Error Reporting groups by stack signature. The live request hung 13.2s before the far end dropped it. That failure escaped the fix above. When the outbound token exchange to Google fails at the network level, requests raises RequestException, which is not an authlib OAuthError — so it propagated and rendered the same bare 500 this PR was written to remove. 1ebdc67 catches it, immediately before the OAuthError handler. Same reasoning applies unchanged: the single-use state is spent whether or not the exchange completed, so retrying that URL can never succeed. Current production breakdown 24 hours of glowscript request logs, every 5xx on /google/auth: cause count covered by MismatchingStateError (subclasses OAuthError) 5 f991582 OAuthError — user clicked Cancel on the consent screen 3 f991582 RequestException / RemoteDisconnected 2 1ebdc67 All ten now redirect instead of 500ing. /google/auth 500s go back to at least 2026-08-25. Testing Third case added to tests/test_auth_callback.py; all 3 pass. Mutation-checked, both directions: removing the RequestException handler fails the network test; removing the OAuthError handler fails the replay test. Each is independently necessary, so neither passes vacuously. Rest of the suite unchanged — 22 passed, with test_plotusers's 2 failures and test_e2e.py's missing playwright both confirmed pre-existing on master by stashing this branch. One more repo note pytest-mock is missing from requirements.txt even though conftest.py requires the mocker fixture. Without it these tests error at setup rather than fail, which reads like a broken test rather than an absent dependency. Not fixed here.

Open Graph Description: Fixes #210. What /google/auth catches OAuthError (the base of MismatchingStateError, also covering a replayed code's invalid_grant) and redirects to / — the only place a user whose callback can...

X Description: Fixes #210. What /google/auth catches OAuthError (the base of MismatchingStateError, also covering a replayed code's invalid_grant) and redirects to / — the only place a user whose callback...

Opengraph URL: https://github.com/vpython/glowscript/pull/211

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:aaac0ec7-1f8e-b90c-cb75-52a6780316da
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idB108:22D266:44FB7:60B30:6B007E36
html-safe-noncea048d027570d816e21c92fcdcb19826e717e26c5312f9a6c24bb06ea8406d7e2
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMTA4OjIyRDI2Njo0NEZCNzo2MEIzMDo2QjAwN0UzNiIsInZpc2l0b3JfaWQiOiI4NTQ4MDg0NTMxMjQ3MjE4MjMwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac1489d75eca20701809b17c9e9dc3088d7cffba0458bf856effc1b4666b935aff
hovercard-subject-tagpull_request:4413966787
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/vpython/glowscript/pull/211/files
twitter:imagehttps://avatars.githubusercontent.com/u/1708412?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/1708412?s=400&v=4
og:image:altFixes #210. What /google/auth catches OAuthError (the base of MismatchingStateError, also covering a replayed code's invalid_grant) and redirects to / — the only place a user whose callback can...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None82c186f13e104004ab7bdb779f3195e59dd38bfde531aaa74b76470fc2462b83
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/vpython/glowscript git https://github.com/vpython/glowscript.git
octolytics-dimension-user_id1280757
octolytics-dimension-user_loginvpython
octolytics-dimension-repository_id187905631
octolytics-dimension-repository_nwovpython/glowscript
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id187905631
octolytics-dimension-repository_network_root_nwovpython/glowscript
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
released1bc2aa1939001689f5ce935982c10a6138f745c
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/vpython/glowscript/pull/211/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fvpython%2Fglowscript%2Fpull%2F211%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fvpython%2Fglowscript%2Fpull%2F211%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=vpython%2Fglowscript
Reloadhttps://github.com/vpython/glowscript/pull/211/files
Reloadhttps://github.com/vpython/glowscript/pull/211/files
Reloadhttps://github.com/vpython/glowscript/pull/211/files
vpythonhttps://github.com/vpython
glowscripthttps://github.com/vpython/glowscript
Codehttps://github.com/vpython/glowscript
Issues9 (9)https://github.com/vpython/glowscript/issues
Pull requests2 (2)https://github.com/vpython/glowscript/pulls
Actionshttps://github.com/vpython/glowscript/actions
Projectshttps://github.com/vpython/glowscript/projects
Security and qualityhttps://github.com/vpython/glowscript/security
Insightshttps://github.com/vpython/glowscript/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fvpython%2Fglowscript%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fvpython%2Fglowscript%2Fissues%2Fnew%2Fchoose
sspicklehttps://github.com/sspickle
masterhttps://github.com/vpython/glowscript/tree/master
fix/auth-callback-500https://github.com/vpython/glowscript/tree/fix/auth-callback-500
Conversation 0 https://github.com/vpython/glowscript/pull/211
Commits 2 https://github.com/vpython/glowscript/pull/211/commits
Checks 0 https://github.com/vpython/glowscript/pull/211/checks
Files changed https://github.com/vpython/glowscript/pull/211/files
Please reload this pagehttps://github.com/vpython/glowscript/pull/211/files
fix(#210): replayed or cookie-less OAuth callbacks redirect home instead of 500 https://github.com/vpython/glowscript/pull/211/files#top
Show all changes 2 commits https://github.com/vpython/glowscript/pull/211/files
f991582 fix: replayed or cookie-less OAuth callbacks redirect home instead of… sspickle Sep 1, 2026 https://github.com/vpython/glowscript/pull/211/commits/f991582b547c2da02cf102fb8933800aaebb61a7
1ebdc67 fix: a network failure reaching Google must not 500 the OAuth callback sspickle Sep 6, 2026 https://github.com/vpython/glowscript/pull/211/commits/1ebdc6715a9fc1780a4697f42374df4ab635a020
Clear filters https://github.com/vpython/glowscript/pull/211/files
Please reload this pagehttps://github.com/vpython/glowscript/pull/211/files
Please reload this pagehttps://github.com/vpython/glowscript/pull/211/files
auth.py https://github.com/vpython/glowscript/pull/211/files#diff-8c313a624a7b7a80991a98d9f24d27b9ed8109069fce83c048e22534e5827f92
test_auth_callback.py https://github.com/vpython/glowscript/pull/211/files#diff-938b7acc7bc8b791f1cf1fd1e4af0a412f4072c2536545dd58e6c2d2b7435f92
ide/auth.pyhttps://github.com/vpython/glowscript/pull/211/files#diff-8c313a624a7b7a80991a98d9f24d27b9ed8109069fce83c048e22534e5827f92
View file https://github.com/vpython/glowscript/blob/1ebdc6715a9fc1780a4697f42374df4ab635a020/ide/auth.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/vpython/glowscript/pull/211/{{ revealButtonHref }}
https://github.com/vpython/glowscript/pull/211/files#diff-8c313a624a7b7a80991a98d9f24d27b9ed8109069fce83c048e22534e5827f92
https://github.com/vpython/glowscript/pull/211/files#diff-8c313a624a7b7a80991a98d9f24d27b9ed8109069fce83c048e22534e5827f92
https://github.com/vpython/glowscript/pull/211/files#diff-8c313a624a7b7a80991a98d9f24d27b9ed8109069fce83c048e22534e5827f92
https://github.com/vpython/glowscript/pull/211/files#diff-8c313a624a7b7a80991a98d9f24d27b9ed8109069fce83c048e22534e5827f92
tests/test_auth_callback.pyhttps://github.com/vpython/glowscript/pull/211/files#diff-938b7acc7bc8b791f1cf1fd1e4af0a412f4072c2536545dd58e6c2d2b7435f92
View file https://github.com/vpython/glowscript/blob/1ebdc6715a9fc1780a4697f42374df4ab635a020/tests/test_auth_callback.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/vpython/glowscript/pull/211/{{ revealButtonHref }}
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.