René's URL Explorer Experiment


Title: fix(file-search): find an owner's stale dependencies from its dependency rows by waleedlatif1 · Pull Request #9024 · simstudioai/sim · GitHub

Open Graph Title: fix(file-search): find an owner's stale dependencies from its dependency rows by waleedlatif1 · Pull Request #9024 · simstudioai/sim

X Title: fix(file-search): find an owner's stale dependencies from its dependency rows by waleedlatif1 · Pull Request #9024 · simstudioai/sim

Description: Summary Follow-up to #8609. The search dispatcher's dependency reconcile walked every ready revision of each queued owner, up to 100 owners per pass, with a per-row dependency NOT EXISTS. The queue delete repeated that walk inside an OR. Cost was O(ready files of the owner) × 2 per owner per pass, all inside one dispatch transaction (10s statement / 20s transaction). A timeout rolled back the lastDispatchedAt rotation, so the same owners went first again and indexing stalled. Before #8609 the queue delete stopped at the first pending row. Migration 0428: adds owner columns to file_search_dependency. A BEFORE INSERT/UPDATE trigger copies them from the build, so the deployed app needs no change and nothing can drift. Then an idempotent backfill after COMMIT, then CREATE INDEX CONCURRENTLY file_search_dependency_owner_idx (entity_type, entity_id, build_id) with failed-build recovery. The table only exists since 0426, so the backfill is small. Reconcile and queue delete now start from the owner's dependency rows through the new index. The stale predicate is shared with the search path, so it can't diverge. The queue delete is back on the partial pending index for the pending check. Results are identical. A revision only ever points at a build of its own owner, and a revision whose build has no dependency rows can never be stale. SKIP LOCKED and wake-up behavior are unchanged. Dev push path: reconcile-file-ownership.ts also runs the 0428 trigger and backfill on pushed databases. Type of Change Bug fix Testing dispatcher.integration.ts adds an owner with 20k ready revisions and one dependency row, inserted the way the old app writes it. It asserts the trigger filled the owner, the stale revision was reconciled and claimed, its build expired, and the owner was dequeued. It also asserts that both statements read under 100 shared blocks. The old code fails both. check:migrations: no blocking findings (one expected data-backfill warning). Full suites in CI. Checklist Code follows project style guidelines Self-reviewed my changes Tests added/updated and passing 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-up to #8609. The search dispatcher's dependency reconcile walked every ready revision of each queued owner, up to 100 owners per pass, with a per-row dependency NOT EXISTS. The q...

X Description: Summary Follow-up to #8609. The search dispatcher's dependency reconcile walked every ready revision of each queued owner, up to 100 owners per pass, with a per-row dependency NOT EXISTS. T...

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

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:4b19a040-fb6f-b060-b110-2ca9a0680faa
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idA1EE:CB99F:65F7B7:909A6B:6AFB4685
html-safe-nonce900d8f6784803bac3d4247cbe1a0bcc6f980a9a0616708980d441a5ede50ba9e
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMUVFOkNCOTlGOjY1RjdCNzo5MDlBNkI6NkFGQjQ2ODUiLCJ2aXNpdG9yX2lkIjoiNzYxODg1MzE0ODI3ODA4MTE1NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac57a8e9a08e4f15b69936a198f605a2aaa1379b9364d93d36f3a6b63310187f4d
hovercard-subject-tagpull_request:4860259607
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/9024/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-up to #8609. The search dispatcher's dependency reconcile walked every ready revision of each queued owner, up to 100 owners per pass, with a per-row dependency NOT EXISTS. The q...
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 full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release26504db649b58525278f77a52b80ba5f10d5f4de
ui-targetcanary-1
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/simstudioai/sim/pull/9024/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F9024%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%2F9024%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/9024/files
Reloadhttps://github.com/simstudioai/sim/pull/9024/files
Reloadhttps://github.com/simstudioai/sim/pull/9024/files
simstudioaihttps://github.com/simstudioai
simhttps://github.com/simstudioai/sim
Codehttps://github.com/simstudioai/sim
Issues129 (129)https://github.com/simstudioai/sim/issues
Pull requests199 (199)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/file-search-dependency-owner-indexhttps://github.com/simstudioai/sim/tree/fix/file-search-dependency-owner-index
Conversation 8 https://github.com/simstudioai/sim/pull/9024
Commits 3 https://github.com/simstudioai/sim/pull/9024/commits
Checks 51 https://github.com/simstudioai/sim/pull/9024/checks
Files changed https://github.com/simstudioai/sim/pull/9024/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/9024/files
fix(file-search): find an owner's stale dependencies from its dependency rows https://github.com/simstudioai/sim/pull/9024/files#top
Show all changes 3 commits https://github.com/simstudioai/sim/pull/9024/files
c589833 fix(file-search): find an owner's stale dependencies from its depende… waleedlatif1 Oct 14, 2026 https://github.com/simstudioai/sim/pull/9024/commits/c58983384e575c8deceb96bdcf3d2fc8cbfdce3e
c042df7 fix(db): run the push-path dependency backfill after the trigger DDL … waleedlatif1 Oct 14, 2026 https://github.com/simstudioai/sim/pull/9024/commits/c042df72e25c785716b51b89a12e8244999de9e7
6ece0a1 fix(file-search): type the owner-index test seed and share the queued… waleedlatif1 Oct 14, 2026 https://github.com/simstudioai/sim/pull/9024/commits/6ece0a1c6683c6a3156fa8d21a981ae5076b4a6b
Clear filters https://github.com/simstudioai/sim/pull/9024/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/9024/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/9024/files
chunks.integration.ts https://github.com/simstudioai/sim/pull/9024/files#diff-1fad4c2aca071eb8a4b477c529687858aacdd570efedc2dca4180d0c7a18cb78
dispatcher.integration.ts https://github.com/simstudioai/sim/pull/9024/files#diff-5f580fffd39ddd529ae710b571e855f28636a56713b8d9f1889d03127d070e02
dispatcher.ts https://github.com/simstudioai/sim/pull/9024/files#diff-6683656d968a1a183bf327531c469e9b0b8eea626f303f8482a0504340be2d1d
scope.ts https://github.com/simstudioai/sim/pull/9024/files#diff-20202c0d6ceeb6c095b00ed196d8d08a7a55aa9cc0b70185befe08834b800be9
0428_file_search_dependency_owner.sql https://github.com/simstudioai/sim/pull/9024/files#diff-2b5ec7029aa554bd716f893b07efc6b34520e46aa78e90a58dc70c628d4591c2
0428_snapshot.json https://github.com/simstudioai/sim/pull/9024/files#diff-43a6f118e62e3177dc6d5d6df10a315bd5eacc7b15fc8b1001fa06b33cedfb56
_journal.json https://github.com/simstudioai/sim/pull/9024/files#diff-37150cc65ad16ee6fbc5fa318fc096be7730e16d63eaf863e3df5521b7030649
schema.ts https://github.com/simstudioai/sim/pull/9024/files#diff-9a959e2ce3cb4c86957bbae021d06eae364f7b0cb18964f5873bab53220af928
reconcile-file-ownership.ts https://github.com/simstudioai/sim/pull/9024/files#diff-9e19b0c4872ae9939f92c3dfaa595a37d3b7f13f268c96c5930acccdc64b3236
schema-tables.generated.ts https://github.com/simstudioai/sim/pull/9024/files#diff-e0edf0f56682cbbb36446389d81ccd7516f377568a0c09cd8e9c1c87b0b1850e
apps/sim/lib/workspace-files/search/chunks.integration.tshttps://github.com/simstudioai/sim/pull/9024/files#diff-1fad4c2aca071eb8a4b477c529687858aacdd570efedc2dca4180d0c7a18cb78
View file https://github.com/simstudioai/sim/blob/6ece0a1c6683c6a3156fa8d21a981ae5076b4a6b/apps/sim/lib/workspace-files/search/chunks.integration.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/9024/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/9024/files#diff-1fad4c2aca071eb8a4b477c529687858aacdd570efedc2dca4180d0c7a18cb78
https://github.com/simstudioai/sim/pull/9024/files#diff-1fad4c2aca071eb8a4b477c529687858aacdd570efedc2dca4180d0c7a18cb78
apps/sim/lib/workspace-files/search/dispatcher.integration.tshttps://github.com/simstudioai/sim/pull/9024/files#diff-5f580fffd39ddd529ae710b571e855f28636a56713b8d9f1889d03127d070e02
View file https://github.com/simstudioai/sim/blob/6ece0a1c6683c6a3156fa8d21a981ae5076b4a6b/apps/sim/lib/workspace-files/search/dispatcher.integration.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/9024/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/9024/files#diff-5f580fffd39ddd529ae710b571e855f28636a56713b8d9f1889d03127d070e02
https://github.com/simstudioai/sim/pull/9024/files#diff-5f580fffd39ddd529ae710b571e855f28636a56713b8d9f1889d03127d070e02
https://github.com/simstudioai/sim/pull/9024/files#diff-5f580fffd39ddd529ae710b571e855f28636a56713b8d9f1889d03127d070e02
https://github.com/simstudioai/sim/pull/9024/files#diff-5f580fffd39ddd529ae710b571e855f28636a56713b8d9f1889d03127d070e02
https://github.com/simstudioai/sim/pull/9024/files#diff-5f580fffd39ddd529ae710b571e855f28636a56713b8d9f1889d03127d070e02
https://github.com/simstudioai/sim/pull/9024/files#diff-5f580fffd39ddd529ae710b571e855f28636a56713b8d9f1889d03127d070e02
apps/sim/lib/workspace-files/search/dispatcher.tshttps://github.com/simstudioai/sim/pull/9024/files#diff-6683656d968a1a183bf327531c469e9b0b8eea626f303f8482a0504340be2d1d
View file https://github.com/simstudioai/sim/blob/6ece0a1c6683c6a3156fa8d21a981ae5076b4a6b/apps/sim/lib/workspace-files/search/dispatcher.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/9024/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/9024/files#diff-6683656d968a1a183bf327531c469e9b0b8eea626f303f8482a0504340be2d1d
https://github.com/simstudioai/sim/pull/9024/files#diff-6683656d968a1a183bf327531c469e9b0b8eea626f303f8482a0504340be2d1d
https://github.com/simstudioai/sim/pull/9024/files#diff-6683656d968a1a183bf327531c469e9b0b8eea626f303f8482a0504340be2d1d
https://github.com/simstudioai/sim/pull/9024/files#diff-6683656d968a1a183bf327531c469e9b0b8eea626f303f8482a0504340be2d1d
https://github.com/simstudioai/sim/pull/9024/files#diff-6683656d968a1a183bf327531c469e9b0b8eea626f303f8482a0504340be2d1d
https://github.com/simstudioai/sim/pull/9024/files#diff-6683656d968a1a183bf327531c469e9b0b8eea626f303f8482a0504340be2d1d
https://github.com/simstudioai/sim/pull/9024/files#diff-6683656d968a1a183bf327531c469e9b0b8eea626f303f8482a0504340be2d1d
https://github.com/simstudioai/sim/pull/9024/files#diff-6683656d968a1a183bf327531c469e9b0b8eea626f303f8482a0504340be2d1d
https://github.com/simstudioai/sim/pull/9024/files#diff-6683656d968a1a183bf327531c469e9b0b8eea626f303f8482a0504340be2d1d
https://github.com/simstudioai/sim/pull/9024/files#diff-6683656d968a1a183bf327531c469e9b0b8eea626f303f8482a0504340be2d1d
https://github.com/simstudioai/sim/pull/9024/files#diff-6683656d968a1a183bf327531c469e9b0b8eea626f303f8482a0504340be2d1d
apps/sim/lib/workspace-files/search/scope.tshttps://github.com/simstudioai/sim/pull/9024/files#diff-20202c0d6ceeb6c095b00ed196d8d08a7a55aa9cc0b70185befe08834b800be9
View file https://github.com/simstudioai/sim/blob/6ece0a1c6683c6a3156fa8d21a981ae5076b4a6b/apps/sim/lib/workspace-files/search/scope.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/9024/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/9024/files#diff-20202c0d6ceeb6c095b00ed196d8d08a7a55aa9cc0b70185befe08834b800be9
packages/db/migrations/0428_file_search_dependency_owner.sqlhttps://github.com/simstudioai/sim/pull/9024/files#diff-2b5ec7029aa554bd716f893b07efc6b34520e46aa78e90a58dc70c628d4591c2
View file https://github.com/simstudioai/sim/blob/6ece0a1c6683c6a3156fa8d21a981ae5076b4a6b/packages/db/migrations/0428_file_search_dependency_owner.sql
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/9024/{{ revealButtonHref }}
Please reload this pagehttps://github.com/simstudioai/sim/pull/9024/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/9024/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.