René's URL Explorer Experiment


Title: fix(oauth): take over a lapsed refresh lease, share overlapping service-account key reads, and label unsearched accounts by waleedlatif1 · Pull Request #9537 · simstudioai/sim · GitHub

Open Graph Title: fix(oauth): take over a lapsed refresh lease, share overlapping service-account key reads, and label unsearched accounts by waleedlatif1 · Pull Request #9537 · simstudioai/sim

X Title: fix(oauth): take over a lapsed refresh lease, share overlapping service-account key reads, and label unsearched accounts by waleedlatif1 · Pull Request #9537 · simstudioai/sim

Description: Summary Follow-ups from a release audit of #9509 (OAuth refresh-ahead) and #9514 (live search latency), rebased on #9528's five-minute floor. A follower takes over a lease its leader left to lapse. The problem: a refresh can be abandoned with its process, as a Trigger.dev run does with detached work. Its leader lease then stays held until the TTL. A caller that has to wait (5 minutes or less left) followed that dead lease for the full wait and got no token. The fix: withLeaderLock now tries the lock once more when a follower's wait and its last read both come up empty. If the follower wins, it leads the refresh itself. If it loses, a live holder has the lease, and it returns null as before. This works for every provider and keeps #9528's guarantee that a served token has at least five minutes left. Nothing serves a stored token below that floor. The leader re-reads the dead flag under the lock, so taking over after a leader failed terminally never calls the provider again with a dead chain. The refresh settle timeout now covers the follower wait plus one takeover lead. Before, the 30s coalesce timeout always fired before the follower's own 30s wait ended, so the follower's last read never counted. The timeout is derived from the lease constants. Overlapping service-account key reads are shared. Google delegation mints one token per subject concurrently, and each mint read and decrypted the same credential row. Concurrent reads now go through coalesceLocally. A later mint still reads again, so revocation is re-checked on every mint. A caller that joins a shared read can still cancel its own wait. Accounts that were never searched are labelled accurately in diagnostics. They get an internal not_started reason instead of a provider timeout with provider_validation. The status and message users see are unchanged. Doc fixes: The refresh-ahead safety note now states only what Google and Microsoft document. refresh-or-reuse now names Instagram as its only user. The account-open concurrency note describes the shared key read. Type of Change Bug fix Testing New tests; each fails on the code before it: Leader lock: A follower whose leader vanished takes over once and leads. A follower that loses the race returns null. Orphaned lease: Google and a non-allowlisted provider both get a freshly refreshed token, with one provider call. A live holder yields no token, never a stored one. The takeover finishes before the settle timeout. Taking over after a dead flag makes no provider call. A hung in-process leader is bounded by the settle timeout. Account gone and dead flag: both fail even with ample validity left. Service-account key: concurrent mints share one key read, and a cancelled mint stops waiting while the others finish. Diagnostics: an account that was never searched is logged as not_started. createConcurrencyLimit: FIFO order, peak never above the limit, and the slot is released on a throw. Live search sessions: a session that never opens frees its slot, and a session that opens late is closed. Checks run: Targeted suites pass: lib/oauth, lib/concurrency, lib/sim-search/live, lib/knowledge/search, lib/core/utils. bun run lint, type-check and check:audits pass. The full suite runs in CI. Checklist Code follows project style guidelines Self-reviewed my changes Tests added/updated and passing (new tests pass the test-audit authoring gate) No new warnings introduced I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Open Graph Description: Summary Follow-ups from a release audit of #9509 (OAuth refresh-ahead) and #9514 (live search latency), rebased on #9528's five-minute floor. A follower takes over a lease its leader left to l...

X Description: Summary Follow-ups from a release audit of #9509 (OAuth refresh-ahead) and #9514 (live search latency), rebased on #9528's five-minute floor. A follower takes over a lease its leader left ...

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

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:76bfe339-0c38-f27f-87dc-7aab95f233e9
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idBA0C:190EF6:7378A:A6CF6:6AFB1890
html-safe-nonce732ac92118c5ff131e9b628988b471773613edec3622e42673611adb3827b50e
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQTBDOjE5MEVGNjo3Mzc4QTpBNkNGNjo2QUZCMTg5MCIsInZpc2l0b3JfaWQiOiI1MzM3NTI4OTEzMzU2MzMxMTUyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac0528ecfbfa8e49d2e34b2f645b5ae3ca153b1bc82e6c7011b5cde1ce84b5552c
hovercard-subject-tagpull_request:5100308152
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/9537/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 Follow-ups from a release audit of #9509 (OAuth refresh-ahead) and #9514 (live search latency), rebased on #9528's five-minute floor. A follower takes over a lease its leader left to l...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None24933791aba0f10b2f189f8b953a1452dd79933933ac13a0a67b8ad3acee3d9f
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 full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release030711cc180b563614a434f4376acf7da5d445fa
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/simstudioai/sim/pull/9537/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F9537%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%2F9537%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/9537/files
Reloadhttps://github.com/simstudioai/sim/pull/9537/files
Reloadhttps://github.com/simstudioai/sim/pull/9537/files
simstudioaihttps://github.com/simstudioai
simhttps://github.com/simstudioai/sim
Codehttps://github.com/simstudioai/sim
Issues129 (129)https://github.com/simstudioai/sim/issues
Pull requests198 (198)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/refresh-and-live-search-audithttps://github.com/simstudioai/sim/tree/fix/refresh-and-live-search-audit
Conversation 21 https://github.com/simstudioai/sim/pull/9537
Commits 5 https://github.com/simstudioai/sim/pull/9537/commits
Checks 69 https://github.com/simstudioai/sim/pull/9537/checks
Files changed https://github.com/simstudioai/sim/pull/9537/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/9537/files
fix(oauth): take over a lapsed refresh lease, share overlapping service-account key reads, and label unsearched accounts https://github.com/simstudioai/sim/pull/9537/files#top
Show all changes 5 commits https://github.com/simstudioai/sim/pull/9537/files
edd0621 fix(search): keep a valid token when a refresh lease is orphaned, sha… waleedlatif1 Oct 31, 2026 https://github.com/simstudioai/sim/pull/9537/commits/edd0621b961015c8a79463f01a2b5a8a225b8f15
3be3109 fix(oauth): serve a stored token only when a refresh wait ran out on … waleedlatif1 Oct 31, 2026 https://github.com/simstudioai/sim/pull/9537/commits/3be3109c30e002468ce04721041c5e9aff9b4130
e8a7934 fix(oauth): let a cancelled service-account mint stop waiting on a sh… waleedlatif1 Oct 31, 2026 https://github.com/simstudioai/sim/pull/9537/commits/e8a793431c54f869090d4d0311ebe0d8d78ca7d7
9a23d4b docs(oauth): say why the stored-token fallback floor sits below the r… waleedlatif1 Oct 31, 2026 https://github.com/simstudioai/sim/pull/9537/commits/9a23d4b82c5bcb6b979dadaa1af823637a53d595
59bc945 fix(oauth): take over a lapsed refresh lease instead of serving the s… waleedlatif1 Oct 31, 2026 https://github.com/simstudioai/sim/pull/9537/commits/59bc9459f612f6bf2a537f612c25df579a1adfd9
Clear filters https://github.com/simstudioai/sim/pull/9537/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/9537/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/9537/files
leader-lock.test.ts https://github.com/simstudioai/sim/pull/9537/files#diff-469bac1e60a361f2f2fe0750685d027eed2a88599e5b45b6412acf774102295c
leader-lock.ts https://github.com/simstudioai/sim/pull/9537/files#diff-cd14b6ef4f7365564fe8866b4d457a8a070a7411c79949b5e1f7e0d4e686873a
concurrency.test.ts https://github.com/simstudioai/sim/pull/9537/files#diff-141766c7b7c7a35b068f54c15a459c07762c030b46ee78d62d8c8528ece4ae9e
diagnostics.ts https://github.com/simstudioai/sim/pull/9537/files#diff-454cb97c4d1f9ca41cc9ec69e41039731b15cf7250ff59d784f19495ea0caea6
credential-service.test.ts https://github.com/simstudioai/sim/pull/9537/files#diff-436d1bec92f572ebd755e550bcec174f860c4c8be1dc751e1dd6498685c7bf55
credential-service.ts https://github.com/simstudioai/sim/pull/9537/files#diff-effb7c3ce97c223dad84239d969592e6300167d635dab9fdfc4bb30120ec3c47
application.test.ts https://github.com/simstudioai/sim/pull/9537/files#diff-af2d21accc00823b671d6bf1cb0dda2f0f273ebdb911e7ec9cdd52ea034a5c20
application.ts https://github.com/simstudioai/sim/pull/9537/files#diff-151e464c65b5447415809287c8c227355b3d21309f26c9399b2e49c0cdd59608
apps/sim/lib/concurrency/leader-lock.test.tshttps://github.com/simstudioai/sim/pull/9537/files#diff-469bac1e60a361f2f2fe0750685d027eed2a88599e5b45b6412acf774102295c
View file https://github.com/simstudioai/sim/blob/59bc9459f612f6bf2a537f612c25df579a1adfd9/apps/sim/lib/concurrency/leader-lock.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/9537/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/9537/files#diff-469bac1e60a361f2f2fe0750685d027eed2a88599e5b45b6412acf774102295c
https://github.com/simstudioai/sim/pull/9537/files#diff-469bac1e60a361f2f2fe0750685d027eed2a88599e5b45b6412acf774102295c
apps/sim/lib/concurrency/leader-lock.tshttps://github.com/simstudioai/sim/pull/9537/files#diff-cd14b6ef4f7365564fe8866b4d457a8a070a7411c79949b5e1f7e0d4e686873a
View file https://github.com/simstudioai/sim/blob/59bc9459f612f6bf2a537f612c25df579a1adfd9/apps/sim/lib/concurrency/leader-lock.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/9537/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/9537/files#diff-cd14b6ef4f7365564fe8866b4d457a8a070a7411c79949b5e1f7e0d4e686873a
https://github.com/simstudioai/sim/pull/9537/files#diff-cd14b6ef4f7365564fe8866b4d457a8a070a7411c79949b5e1f7e0d4e686873a
https://github.com/simstudioai/sim/pull/9537/files#diff-cd14b6ef4f7365564fe8866b4d457a8a070a7411c79949b5e1f7e0d4e686873a
https://github.com/simstudioai/sim/pull/9537/files#diff-cd14b6ef4f7365564fe8866b4d457a8a070a7411c79949b5e1f7e0d4e686873a
apps/sim/lib/core/utils/concurrency.test.tshttps://github.com/simstudioai/sim/pull/9537/files#diff-141766c7b7c7a35b068f54c15a459c07762c030b46ee78d62d8c8528ece4ae9e
View file https://github.com/simstudioai/sim/blob/59bc9459f612f6bf2a537f612c25df579a1adfd9/apps/sim/lib/core/utils/concurrency.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/9537/{{ revealButtonHref }}
apps/sim/lib/knowledge/search/diagnostics.tshttps://github.com/simstudioai/sim/pull/9537/files#diff-454cb97c4d1f9ca41cc9ec69e41039731b15cf7250ff59d784f19495ea0caea6
View file https://github.com/simstudioai/sim/blob/59bc9459f612f6bf2a537f612c25df579a1adfd9/apps/sim/lib/knowledge/search/diagnostics.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/9537/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/9537/files#diff-454cb97c4d1f9ca41cc9ec69e41039731b15cf7250ff59d784f19495ea0caea6
https://github.com/simstudioai/sim/pull/9537/files#diff-454cb97c4d1f9ca41cc9ec69e41039731b15cf7250ff59d784f19495ea0caea6
Please reload this pagehttps://github.com/simstudioai/sim/pull/9537/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/9537/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.