René's URL Explorer Experiment


Title: fix(file-search): store workspace file revisions at millisecond precision by waleedlatif1 · Pull Request #7941 · simstudioai/sim · GitHub

Open Graph Title: fix(file-search): store workspace file revisions at millisecond precision by waleedlatif1 · Pull Request #7941 · simstudioai/sim

X Title: fix(file-search): store workspace file revisions at millisecond precision by waleedlatif1 · Pull Request #7941 · simstudioai/sim

Description: Summary workspace_files.content_updated_at is a revision identity that round-trips through JavaScript Date and JSON (both millisecond), while now() stores microseconds. A sub-millisecond revision stops comparing equal to its own round-trip, so every SQL equality keyed on it matches zero rows — the file is never claimed, never indexed, and never cleaned up, because the only cleanup path (markTerminal) is itself gated behind being dispatched. Migration 0357 truncates the column default and adds a BEFORE INSERT OR UPDATE trigger for the writers a default cannot reach: explicit CURRENT_TIMESTAMP expressions, raw SQL inserts, and any UPDATE. It is DDL-only, so it stays idempotent under the autocommit path a fresh install takes after 0355's embedded COMMIT, and holds its lock for DDL rather than for a data rewrite. Script migration 0018 retires the rows minted before the invariant existed, keyset-paginated and batched. Each batch is one transaction so the secret_provenance_version that workspace_files_secret_provenance_demote nulls is restored with its sidecar, instead of being lost if a run dies midway. Scoped to context = 'workspace', live and soft-deleted: those are the rows the search index keys on, and a soft-deleted row is restored by paths that do not rewrite the column. Other contexts are never search-indexed and only compare this column in JavaScript, where both sides are already millisecond; the trigger normalizes them on their next content write. The trigger name sorts before workspace_files_secret_provenance_demote, so that trigger's WHEN clause compares the normalized value and a write that does not change the millisecond revision no longer demotes provenance. There is a test for both directions. No application code changes. Complements #7940, which bounds the claim query: that made the dispatcher cheap, this makes the rows claimable. Type of Change Bug fix Testing 10 PostgreSQL 17 tests covering the invariant (default expression, explicit microsecond write, CURRENT_TIMESTAMP restore write, trigger ordering vs provenance demotion in both directions) and the repair (scoping, sidecar realignment, orphaned index/segment rows, replay no-op, keyset progress). Wired into the existing packages/db CI step. Verified the repair against a seeded 5.6M-row workspace_files: 94,196 rows repaired in 2.4s, replay a 0.5s no-op, other contexts untouched, tracked provenance versions and sidecars preserved. Verified 0357 applies and replays cleanly both in autocommit and inside a transaction. bun run lint, all 46 audits, docs-manifest:check, check:migrations origin/staging, and type-check pass. 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 workspace_files.content_updated_at is a revision identity that round-trips through JavaScript Date and JSON (both millisecond), while now() stores microseconds. A sub-millisecond revision ...

X Description: Summary workspace_files.content_updated_at is a revision identity that round-trips through JavaScript Date and JSON (both millisecond), while now() stores microseconds. A sub-millisecond revision ...

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

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:554b82a3-f489-e8e7-bdf7-a68ca3140768
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id8ADE:19FA2E:BEAFB6:10D96EF:6AFB5C7B
html-safe-nonce861b58518a21e8def5ae49dd491fa33cd738fc500c9d8624cb59a55a271da435
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QURFOjE5RkEyRTpCRUFGQjY6MTBEOTZFRjo2QUZCNUM3QiIsInZpc2l0b3JfaWQiOiI0MjQ0NDM3ODgyNzA0NjAwMjciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac53a2d2f739edb85f496e953e73e7c7b6c658efd752fc00ccc811dfd2b68225fe
hovercard-subject-tagpull_request:4562788192
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/7941/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 workspace_files.content_updated_at is a revision identity that round-trips through JavaScript Date and JSON (both millisecond), while now() stores microseconds. A sub-millisecond revision ...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Noneea33d13c96d0ff66bd8fa906b193d2213536b78cb06b0c50a4632c58b1418f94
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
release59ef97164c52cf59bd10558ddec9c4f482763988
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/simstudioai/sim/pull/7941/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F7941%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%2F7941%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/7941/files
Reloadhttps://github.com/simstudioai/sim/pull/7941/files
Reloadhttps://github.com/simstudioai/sim/pull/7941/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/workspace-file-content-revision-precisionhttps://github.com/simstudioai/sim/tree/fix/workspace-file-content-revision-precision
Conversation 17 https://github.com/simstudioai/sim/pull/7941
Commits 5 https://github.com/simstudioai/sim/pull/7941/commits
Checks 33 https://github.com/simstudioai/sim/pull/7941/checks
Files changed https://github.com/simstudioai/sim/pull/7941/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/7941/files
fix(file-search): store workspace file revisions at millisecond precision https://github.com/simstudioai/sim/pull/7941/files#top
Show all changes 5 commits https://github.com/simstudioai/sim/pull/7941/files
05439c3 fix(file-search): store workspace file revisions at millisecond preci… waleedlatif1 Sep 17, 2026 https://github.com/simstudioai/sim/pull/7941/commits/05439c30de26785cee7b8868c61224b3c6cbf503
c50a045 fix(file-search): normalize revisions promoted by metadata-only writes waleedlatif1 Sep 17, 2026 https://github.com/simstudioai/sim/pull/7941/commits/c50a0459cb17a8ee03a6c38b634415d501c3d193
4ad1df1 chore(db): drop the 0357 migration ahead of renumbering waleedlatif1 Sep 17, 2026 https://github.com/simstudioai/sim/pull/7941/commits/4ad1df13e852ed54a28855a3705a2c093a762c7e
dfbfb4b Merge staging into fix/workspace-file-content-revision-precision waleedlatif1 Sep 17, 2026 https://github.com/simstudioai/sim/pull/7941/commits/dfbfb4b1b244bd4d4732f6521539b6f14217e72c
cc01970 chore(db): renumber the content revision migration to 0358 waleedlatif1 Sep 17, 2026 https://github.com/simstudioai/sim/pull/7941/commits/cc01970cec65ffee0937a689f6fb3daedd8135cc
Clear filters https://github.com/simstudioai/sim/pull/7941/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/7941/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/7941/files
test-build.yml https://github.com/simstudioai/sim/pull/7941/files#diff-a583f7935a5f3192471a2999cbf059eadc857228b5be2c7247f481b799949f8d
0358_workspace_file_content_version_precision.sql https://github.com/simstudioai/sim/pull/7941/files#diff-046cea376c8efb5218887374667bb68983acc4445822d17ea726722b50130ca6
0358_snapshot.json https://github.com/simstudioai/sim/pull/7941/files#diff-5e6007aff0e8070d26cf9ae6ddd5996b189f322e89d3d479b8c2ce5b5618883b
_journal.json https://github.com/simstudioai/sim/pull/7941/files#diff-37150cc65ad16ee6fbc5fa318fc096be7730e16d63eaf863e3df5521b7030649
schema.ts https://github.com/simstudioai/sim/pull/7941/files#diff-9a959e2ce3cb4c86957bbae021d06eae364f7b0cb18964f5873bab53220af928
script-migrations-paused-billing-attribution.test.ts https://github.com/simstudioai/sim/pull/7941/files#diff-509458c3951fa9cd2e97a7942fd977a83ef520c679d29dc242a5b2cacfb02743
0016_backfill_search_vectors.postgres.test.ts https://github.com/simstudioai/sim/pull/7941/files#diff-356dbbd8454d0f54e3461aeedfa2b0bec37bfa5930f8272878b0455ab14d6711
0018_repair_workspace_file_content_revision.postgres.test.ts https://github.com/simstudioai/sim/pull/7941/files#diff-92ddee18e067788a1a2d352743ae1cb4a3acc8fe9d67234caff843f0109a81f6
0018_repair_workspace_file_content_revision.ts https://github.com/simstudioai/sim/pull/7941/files#diff-09aa8463f4e49a226d9adfb7f2656e8bd995695d5b0006b7d2bcbbe858bbb37e
index.ts https://github.com/simstudioai/sim/pull/7941/files#diff-4c8058a0b924ce061c5ce010c1308148ea03720952dda10d03cee092b61adbd6
.github/workflows/test-build.ymlhttps://github.com/simstudioai/sim/pull/7941/files#diff-a583f7935a5f3192471a2999cbf059eadc857228b5be2c7247f481b799949f8d
View file https://github.com/simstudioai/sim/blob/cc01970cec65ffee0937a689f6fb3daedd8135cc/.github/workflows/test-build.yml
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/7941/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/7941/files#diff-a583f7935a5f3192471a2999cbf059eadc857228b5be2c7247f481b799949f8d
Please reload this pagehttps://github.com/simstudioai/sim/pull/7941/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/7941/files
https://github.com/simstudioai/sim/pull/7941/files#diff-a583f7935a5f3192471a2999cbf059eadc857228b5be2c7247f481b799949f8d
packages/db/migrations/0358_workspace_file_content_version_precision.sqlhttps://github.com/simstudioai/sim/pull/7941/files#diff-046cea376c8efb5218887374667bb68983acc4445822d17ea726722b50130ca6
View file https://github.com/simstudioai/sim/blob/cc01970cec65ffee0937a689f6fb3daedd8135cc/packages/db/migrations/0358_workspace_file_content_version_precision.sql
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/7941/{{ revealButtonHref }}
Please reload this pagehttps://github.com/simstudioai/sim/pull/7941/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/7941/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.