René's URL Explorer Experiment


Title: fix(realtime): end a failed socket-token attempt promptly and honor Retry-After by waleedlatif1 · Pull Request #8952 · simstudioai/sim · GitHub

Open Graph Title: fix(realtime): end a failed socket-token attempt promptly and honor Retry-After by waleedlatif1 · Pull Request #8952 · simstudioai/sim

X Title: fix(realtime): end a failed socket-token attempt promptly and honor Retry-After by waleedlatif1 · Pull Request #8952 · simstudioai/sim

Description: Summary When the realtime socket's auth callback can't get a token from /api/auth/socket-token (a 429 from its 30/min per-IP limit, a network error, or a 5xx), it never called cb. socket.io-client 4.8.1 sends CONNECT only from inside cb (socket.js:407-423), and the client's own 10s timeout is cleared once the transport opens (manager.js:135-170). So the attempt sat open until the realtime server's default 45s connect timeout, and users saw "Reconnecting…" the whole time. Retry-After was ignored. Just ending the attempt early isn't enough. The Manager resets its backoff on every transport open (manager.js:306, 361-365), so it would retry about once a second forever. The fix, for any failure other than 401: Disconnect the socket and clear the connection state the same way the disconnect handler does. Without that, a reconnect followed by an auth failure would keep showing "connected". Reconnect after backoffWithJitter (1s growing to 30s, the existing auth-retry constants). When the server sent Retry-After (parsed with parseRetryAfter, capped at 5 min because the route's bucket refills over 60s), wait at least that long, plus up to 20% jitter so tabs behind one IP don't retry in the same second. Reuse the provider's existing retry timer. If the provider has unmounted, signed out or switched workspace, the !active guard means nothing gets scheduled. The attempt counter resets on connect. The 401 path (session gone, passes a null token, goes terminal) is unchanged. No server or rate-limit changes. Effect: "Reconnecting…" appears after the existing 2s anti-flicker delay instead of about 45s, and the socket reconnects as soon as the backoff or Retry-After allows. During a long token-route outage, each tab retries about every 30s, compared with about every 46s before. Verified against a real Socket.IO server with a script: the old code hangs; the new code ends the attempt promptly, waits the delay, then connects; a 401 still produces connect_error with active=false. An adversarial review checked re-entrancy, timer races, unmount and sign-out, and backoff resets. Its two findings, the stale isConnected and the jitter, are included here. Test plan CI type-check and lint e2e (mobile, *): the socket-token mint check still passes

Open Graph Description: Summary When the realtime socket's auth callback can't get a token from /api/auth/socket-token (a 429 from its 30/min per-IP limit, a network error, or a 5xx), it never called cb. socket.io...

X Description: Summary When the realtime socket's auth callback can't get a token from /api/auth/socket-token (a 429 from its 30/min per-IP limit, a network error, or a 5xx), it never called cb. s...

Opengraph URL: https://github.com/simstudioai/sim/pull/8952

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:6cb3b0e7-9887-5245-87b2-59548ed1ce79
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idE3C4:3B3600:99BB9A:D3813E:6AFB4C0B
html-safe-nonce3800a08fd2e19be61ec54f793ce5af3be11834d41b122e6899ddae44e587a8a6
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFM0M0OjNCMzYwMDo5OUJCOUE6RDM4MTNFOjZBRkI0QzBCIiwidmlzaXRvcl9pZCI6IjUyNDkzNjUxMzE4Mjg4NzQyNTEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac2b78b645fa8ce0c001add410f10812e658053389bc3905eedfd57a9e042ee4bf
hovercard-subject-tagpull_request:4837465359
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/simstudioai/sim/pull/8952/files
twitter:imagehttps://avatars.githubusercontent.com/u/40672544?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/40672544?s=400&v=4
og:image:altSummary When the realtime socket's auth callback can't get a token from /api/auth/socket-token (a 429 from its 30/min per-IP limit, a network error, or a 5xx), it never called cb. socket.io...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Noneacf7616d06cc051644705b379878c9bb13dc5e70ecf4ffd9b34140f8ac01d7e1
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/simstudioai/sim git https://github.com/simstudioai/sim.git
octolytics-dimension-user_id199344406
octolytics-dimension-user_loginsimstudioai
octolytics-dimension-repository_id912559512
octolytics-dimension-repository_nwosimstudioai/sim
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id912559512
octolytics-dimension-repository_network_root_nwosimstudioai/sim
turbo-body-classeslogged-out env-production page-responsive
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release26504db649b58525278f77a52b80ba5f10d5f4de
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/simstudioai/sim/pull/8952/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F8952%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%2Fsimstudioai%2Fsim%2Fpull%2F8952%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=simstudioai%2Fsim
Reloadhttps://github.com/simstudioai/sim/pull/8952/files
Reloadhttps://github.com/simstudioai/sim/pull/8952/files
Reloadhttps://github.com/simstudioai/sim/pull/8952/files
simstudioaihttps://github.com/simstudioai
simhttps://github.com/simstudioai/sim
Codehttps://github.com/simstudioai/sim
Issues129 (129)https://github.com/simstudioai/sim/issues
Pull requests197 (197)https://github.com/simstudioai/sim/pulls
Actionshttps://github.com/simstudioai/sim/actions
Projectshttps://github.com/simstudioai/sim/projects
Security and qualityhttps://github.com/simstudioai/sim/security
Insightshttps://github.com/simstudioai/sim/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fsimstudioai%2Fsim%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fsimstudioai%2Fsim%2Fissues%2Fnew%2Fchoose
waleedlatif1https://github.com/waleedlatif1
staginghttps://github.com/simstudioai/sim/tree/staging
fix/socket-token-auth-callbackhttps://github.com/simstudioai/sim/tree/fix/socket-token-auth-callback
Conversation 10 https://github.com/simstudioai/sim/pull/8952
Commits 4 https://github.com/simstudioai/sim/pull/8952/commits
Checks 49 https://github.com/simstudioai/sim/pull/8952/checks
Files changed https://github.com/simstudioai/sim/pull/8952/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/8952/files
fix(realtime): end a failed socket-token attempt promptly and honor Retry-After https://github.com/simstudioai/sim/pull/8952/files#top
Show all changes 4 commits https://github.com/simstudioai/sim/pull/8952/files
190b815 fix(realtime): end the socket attempt when the token mint fails waleedlatif1 Oct 13, 2026 https://github.com/simstudioai/sim/pull/8952/commits/190b815487193f85753d1337578a0e3e66707116
fe7e147 fix(realtime): clear connected state and jitter Retry-After on token … waleedlatif1 Oct 13, 2026 https://github.com/simstudioai/sim/pull/8952/commits/fe7e14735e2dce0a5da6da6d96b75760e6649d14
ccd81ba fix(realtime): tighten the token-retry comment waleedlatif1 Oct 13, 2026 https://github.com/simstudioai/sim/pull/8952/commits/ccd81bac34427128ffd177ac70f82b59e59113de
7adc8a3 fix(realtime): ignore token failures from a superseded handshake and … waleedlatif1 Oct 13, 2026 https://github.com/simstudioai/sim/pull/8952/commits/7adc8a371fe43b403003585fc2aff40f3b25d79c
Clear filters https://github.com/simstudioai/sim/pull/8952/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/8952/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/8952/files
apps/sim/app/workspace/providers/socket-provider.tsxhttps://github.com/simstudioai/sim/pull/8952/files#diff-645e13e3a4827b0a88e66b25a614a116dd7838dddb42745a86247d3a8ca8ab61
View file https://github.com/simstudioai/sim/blob/7adc8a371fe43b403003585fc2aff40f3b25d79c/apps/sim/app/workspace/providers/socket-provider.tsx
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/8952/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/8952/files#diff-645e13e3a4827b0a88e66b25a614a116dd7838dddb42745a86247d3a8ca8ab61
https://github.com/simstudioai/sim/pull/8952/files#diff-645e13e3a4827b0a88e66b25a614a116dd7838dddb42745a86247d3a8ca8ab61
https://github.com/simstudioai/sim/pull/8952/files#diff-645e13e3a4827b0a88e66b25a614a116dd7838dddb42745a86247d3a8ca8ab61
https://github.com/simstudioai/sim/pull/8952/files#diff-645e13e3a4827b0a88e66b25a614a116dd7838dddb42745a86247d3a8ca8ab61
https://github.com/simstudioai/sim/pull/8952/files#diff-645e13e3a4827b0a88e66b25a614a116dd7838dddb42745a86247d3a8ca8ab61
https://github.com/simstudioai/sim/pull/8952/files#diff-645e13e3a4827b0a88e66b25a614a116dd7838dddb42745a86247d3a8ca8ab61
https://github.com/simstudioai/sim/pull/8952/files#diff-645e13e3a4827b0a88e66b25a614a116dd7838dddb42745a86247d3a8ca8ab61
https://github.com/simstudioai/sim/pull/8952/files#diff-645e13e3a4827b0a88e66b25a614a116dd7838dddb42745a86247d3a8ca8ab61
https://github.com/simstudioai/sim/pull/8952/files#diff-645e13e3a4827b0a88e66b25a614a116dd7838dddb42745a86247d3a8ca8ab61
https://github.com/simstudioai/sim/pull/8952/files#diff-645e13e3a4827b0a88e66b25a614a116dd7838dddb42745a86247d3a8ca8ab61
https://github.com/simstudioai/sim/pull/8952/files#diff-645e13e3a4827b0a88e66b25a614a116dd7838dddb42745a86247d3a8ca8ab61
Please reload this pagehttps://github.com/simstudioai/sim/pull/8952/files
https://github.com/simstudioai/sim/pull/8952/files#diff-645e13e3a4827b0a88e66b25a614a116dd7838dddb42745a86247d3a8ca8ab61
Please reload this pagehttps://github.com/simstudioai/sim/pull/8952/files
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.