René's URL Explorer Experiment


Title: fix(tables): log row writes to the change log instead of locking the table definition row by TheodoreSpeaks · Pull Request #8765 · simstudioai/sim · GitHub

Open Graph Title: fix(tables): log row writes to the change log instead of locking the table definition row by TheodoreSpeaks · Pull Request #8765 · simstudioai/sim

X Title: fix(tables): log row writes to the change log instead of locking the table definition row by TheodoreSpeaks · Pull Request #8765 · simstudioai/sim

Description: Summary Phase 2 of #8653: the user_table_rows triggers append to user_table_row_changes instead of updating the table's user_table_definitions row, so a row write no longer locks shared per-table state. A commit stalled on synchronous replication no longer makes every other writer to that table queue behind it and fail at the 3 s lock_timeout Insert/delete statement triggers log one +n / -n row per table per statement — that row is both the row-count delta and the version bump, replacing the row-count triggers (0224) and the version insert/delete triggers (0240, dropped). The deferred update trigger (0390) keeps its column filter and per-transaction dedupe and logs a zero-delta row Delete and update triggers skip tables whose definition is already gone: deleting a table or workspace cascades into its rows after the definition row is deleted, and logging those would violate the log's foreign key Swap runs in one transaction, so no write is double-counted or missed mid-migration. Readers already add the unfolded tail (#8653), so the deployed app reads the same values before and after the migration apply-dev-table-triggers.ts installs the same functions and reconciles stored + tail against real counts; stale comments about the trigger lock updated Requires #8653 deployed to prod first (it is merged) and the fold cron running (infra #406) Type of Change Bug fix Testing New row-writes.integration.ts case: a second session holds the definition row FOR NO KEY UPDATE (what a commit stuck in SyncRep holds) while insert, batch insert, upsert, update by id, update by filter, delete by filter, and replace each run. All seven commit (56 ms total) and live count = COUNT(*). Against the pre-change triggers the first insert fails at the 3 s lock timeout The cascade-delete foreign-key bug was caught by the TTL suite's fixture cleanup before the guard was added Table suites + TTL cleanup on a migrated DB: 148 passed; push-provisioned: 117 passed (migration-only cases skip as before). rows_version and TTL helpers now read stored + tail bun run lint, check:audits, check:migrations origin/staging, block-registry check, docs-manifest:check, drizzle generate clean, 1,011 table unit tests; root bun run test green except one desktop terminal test that passes in isolation 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) 🤖 Generated with Claude Code https://claude.ai/code/session_01CJxC2fgucGVpT59RV5Z7xv

Open Graph Description: Summary Phase 2 of #8653: the user_table_rows triggers append to user_table_row_changes instead of updating the table's user_table_definitions row, so a row write no longer locks shared per-ta...

X Description: Summary Phase 2 of #8653: the user_table_rows triggers append to user_table_row_changes instead of updating the table's user_table_definitions row, so a row write no longer locks shared pe...

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

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:852b524f-aa87-d8e2-4a6d-c72d34ad1dc2
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id8A94:2550AC:8A3C86:C2CDB2:6AFB6F43
html-safe-nonce61b9bb014672cbd058c4f22588068d3db5acbb88c942c6d83778d9c8e4504a0c
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QTk0OjI1NTBBQzo4QTNDODY6QzJDREIyOjZBRkI2RjQzIiwidmlzaXRvcl9pZCI6IjI1NjI1MjIyOTAwODk3NzczMiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac9c2aee25adccf756e96fa36893026270ec208a1513c895003e8cb1b17d05b481
hovercard-subject-tagpull_request:4778998887
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/8765/files
twitter:imagehttps://avatars.githubusercontent.com/u/19564703?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/19564703?s=400&v=4
og:image:altSummary Phase 2 of #8653: the user_table_rows triggers append to user_table_row_changes instead of updating the table's user_table_definitions row, so a row write no longer locks shared per-ta...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonecca289ecd54650fcf3c0b037a58b97186dee2cc4406819d87fab93728fd83700
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
release88808b1fae5ab8a526a73e7ce5542a10eb9d6971
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/simstudioai/sim/pull/8765/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F8765%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%2F8765%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/8765/files
Reloadhttps://github.com/simstudioai/sim/pull/8765/files
Reloadhttps://github.com/simstudioai/sim/pull/8765/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
TheodoreSpeakshttps://github.com/TheodoreSpeaks
staginghttps://github.com/simstudioai/sim/tree/staging
fix/table-row-change-triggershttps://github.com/simstudioai/sim/tree/fix/table-row-change-triggers
Conversation 18 https://github.com/simstudioai/sim/pull/8765
Commits 3 https://github.com/simstudioai/sim/pull/8765/commits
Checks 45 https://github.com/simstudioai/sim/pull/8765/checks
Files changed https://github.com/simstudioai/sim/pull/8765/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/8765/files
fix(tables): log row writes to the change log instead of locking the table definition row https://github.com/simstudioai/sim/pull/8765/files#top
Show all changes 3 commits https://github.com/simstudioai/sim/pull/8765/files
513ca59 fix(tables): log row writes to the change log instead of locking the … TheodoreSpeaks Oct 7, 2026 https://github.com/simstudioai/sim/pull/8765/commits/513ca5943dc896192de1f37ff45412de3f3c424b
52c8e27 fix(tables): lock the change log before the dev count reconcile, and … TheodoreSpeaks Oct 8, 2026 https://github.com/simstudioai/sim/pull/8765/commits/52c8e2753018f7f7e86e7e76fd17657911fafe8c
e79bbff test(tables): name the renumbered change-log migration TheodoreSpeaks Oct 8, 2026 https://github.com/simstudioai/sim/pull/8765/commits/e79bbffcaa55f342fa6d608e7133feddb3ba724b
Clear filters https://github.com/simstudioai/sim/pull/8765/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/8765/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/8765/files
cleanup-table-row-ttl.integration.ts https://github.com/simstudioai/sim/pull/8765/files#diff-17620ef1383d58f646751c97298740bc1fa65c2261e7520d581cc8bddf1243ff
ordering.ts https://github.com/simstudioai/sim/pull/8765/files#diff-ae68362b6a8201eef72124d4fa40ebc0332664f66d7487e04d435623e408658f
row-writes.integration.ts https://github.com/simstudioai/sim/pull/8765/files#diff-653e2260e6bc1166f12f87c1cd10329f4ae89e569dc2f54ade8cf6b57c027468
service.ts https://github.com/simstudioai/sim/pull/8765/files#diff-691e9b1dc59be0015a1be5ea6189899b241d4e979a8b40e088dd7d722cfaadb6
0402_table_row_change_triggers.sql https://github.com/simstudioai/sim/pull/8765/files#diff-9766004e60d1ead30592d7d9da0395f6e46d1466897337744322b4034c2d365f
0402_snapshot.json https://github.com/simstudioai/sim/pull/8765/files#diff-8f1e2d15a7c0bf56f4dc09816e8f831601f4cd325cd9b5325b0169aa9c205130
_journal.json https://github.com/simstudioai/sim/pull/8765/files#diff-37150cc65ad16ee6fbc5fa318fc096be7730e16d63eaf863e3df5521b7030649
schema.ts https://github.com/simstudioai/sim/pull/8765/files#diff-9a959e2ce3cb4c86957bbae021d06eae364f7b0cb18964f5873bab53220af928
apply-dev-table-triggers.ts https://github.com/simstudioai/sim/pull/8765/files#diff-a7ba82369ebd5dca216ed044347d2fa6b0cab46d927c386dd84c3cdfb436d5ec
apps/sim/background/cleanup-table-row-ttl.integration.tshttps://github.com/simstudioai/sim/pull/8765/files#diff-17620ef1383d58f646751c97298740bc1fa65c2261e7520d581cc8bddf1243ff
View file https://github.com/simstudioai/sim/blob/e79bbffcaa55f342fa6d608e7133feddb3ba724b/apps/sim/background/cleanup-table-row-ttl.integration.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/8765/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/8765/files#diff-17620ef1383d58f646751c97298740bc1fa65c2261e7520d581cc8bddf1243ff
https://github.com/simstudioai/sim/pull/8765/files#diff-17620ef1383d58f646751c97298740bc1fa65c2261e7520d581cc8bddf1243ff
apps/sim/lib/table/rows/ordering.tshttps://github.com/simstudioai/sim/pull/8765/files#diff-ae68362b6a8201eef72124d4fa40ebc0332664f66d7487e04d435623e408658f
View file https://github.com/simstudioai/sim/blob/e79bbffcaa55f342fa6d608e7133feddb3ba724b/apps/sim/lib/table/rows/ordering.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/8765/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/8765/files#diff-ae68362b6a8201eef72124d4fa40ebc0332664f66d7487e04d435623e408658f
https://github.com/simstudioai/sim/pull/8765/files#diff-ae68362b6a8201eef72124d4fa40ebc0332664f66d7487e04d435623e408658f
apps/sim/lib/table/rows/row-writes.integration.tshttps://github.com/simstudioai/sim/pull/8765/files#diff-653e2260e6bc1166f12f87c1cd10329f4ae89e569dc2f54ade8cf6b57c027468
View file https://github.com/simstudioai/sim/blob/e79bbffcaa55f342fa6d608e7133feddb3ba724b/apps/sim/lib/table/rows/row-writes.integration.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/8765/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/8765/files#diff-653e2260e6bc1166f12f87c1cd10329f4ae89e569dc2f54ade8cf6b57c027468
https://github.com/simstudioai/sim/pull/8765/files#diff-653e2260e6bc1166f12f87c1cd10329f4ae89e569dc2f54ade8cf6b57c027468
https://github.com/simstudioai/sim/pull/8765/files#diff-653e2260e6bc1166f12f87c1cd10329f4ae89e569dc2f54ade8cf6b57c027468
https://github.com/simstudioai/sim/pull/8765/files#diff-653e2260e6bc1166f12f87c1cd10329f4ae89e569dc2f54ade8cf6b57c027468
https://github.com/simstudioai/sim/pull/8765/files#diff-653e2260e6bc1166f12f87c1cd10329f4ae89e569dc2f54ade8cf6b57c027468
https://github.com/simstudioai/sim/pull/8765/files#diff-653e2260e6bc1166f12f87c1cd10329f4ae89e569dc2f54ade8cf6b57c027468
Please reload this pagehttps://github.com/simstudioai/sim/pull/8765/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/8765/files
https://github.com/simstudioai/sim/pull/8765/files#diff-653e2260e6bc1166f12f87c1cd10329f4ae89e569dc2f54ade8cf6b57c027468
apps/sim/lib/table/service.tshttps://github.com/simstudioai/sim/pull/8765/files#diff-691e9b1dc59be0015a1be5ea6189899b241d4e979a8b40e088dd7d722cfaadb6
View file https://github.com/simstudioai/sim/blob/e79bbffcaa55f342fa6d608e7133feddb3ba724b/apps/sim/lib/table/service.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/8765/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/8765/files#diff-691e9b1dc59be0015a1be5ea6189899b241d4e979a8b40e088dd7d722cfaadb6
https://github.com/simstudioai/sim/pull/8765/files#diff-691e9b1dc59be0015a1be5ea6189899b241d4e979a8b40e088dd7d722cfaadb6
packages/db/migrations/0402_table_row_change_triggers.sqlhttps://github.com/simstudioai/sim/pull/8765/files#diff-9766004e60d1ead30592d7d9da0395f6e46d1466897337744322b4034c2d365f
View file https://github.com/simstudioai/sim/blob/e79bbffcaa55f342fa6d608e7133feddb3ba724b/packages/db/migrations/0402_table_row_change_triggers.sql
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/8765/{{ revealButtonHref }}
Please reload this pagehttps://github.com/simstudioai/sim/pull/8765/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/8765/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.