René's URL Explorer Experiment


Title: fix(projects): fence file writers with a shared Project lock by waleedlatif1 · Pull Request #9025 · simstudioai/sim · GitHub

Open Graph Title: fix(projects): fence file writers with a shared Project lock by waleedlatif1 · Pull Request #9025 · simstudioai/sim

X Title: fix(projects): fence file writers with a shared Project lock by waleedlatif1 · Pull Request #9025 · simstudioai/sim

Description: Summary Follow-up to #8609, which replaced the per-workspace folder lock on about 15 workspace-file write paths with lockWorkspaceProject: an exclusive advisory lock on the whole Project (a workspace and all its forks), with a 5s bound that becomes a 409 ProjectConflictError. Rename, delete, restore, image-dimension and chat-upload writes previously took no lock. Under #8609, every file write in every environment of a Project serialized, and contention surfaced as random 409s. File writers take the Project lock shared. They only need to be fenced against exclusive lifecycle holders: fork and split, archive, payer transfer, departure handoff, account deletion and retention. No workspace-file invariant needs writers to exclude each other: names use the per-workspace directory lock, storage uses the workspace row then the payer row, and revisions use file-row locks. The new lockWorkspaceProjectExclusive keeps today's semantics for fork, split and archiveWorkspace. I checked every caller, and no transaction upgrades from shared to exclusive. Bulk archive and folder restore lock the workspace row first. Their multi-row deleted_at updates upsert the search dispatch queue through the trigger, which deadlocked with a concurrent content write. The exclusive Project lock had been hiding that. Organization departure takes Project locks before the workspace-row owner update. Previously it locked workspace row then Project, the reverse of the file writers' Project then workspace row, which could deadlock with a file write in a fork Project. Payer transfer: zero-byte transfers skip the missing-destination check, Projects are locked once in order instead of one by one (and twice), and the test-only changeWorkspaceStoragePayersInTx entry point and its dead branch are removed. Tests now go through the real entry point. Type of Change Bug fix Testing foundation.integration.ts: while one writer holds the shared Project lock, a writer in a sibling environment proceeds immediately (on the old code it hit the 5s timeout), and an exclusive lifecycle holder is still blocked. workspace-file-folder-manager.test.ts passes locally (12/12). 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, which replaced the per-workspace folder lock on about 15 workspace-file write paths with lockWorkspaceProject: an exclusive advisory lock on the whole Project (a workspa...

X Description: Summary Follow-up to #8609, which replaced the per-workspace folder lock on about 15 workspace-file write paths with lockWorkspaceProject: an exclusive advisory lock on the whole Project (a workspa...

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

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:178663fd-1cb5-55ff-6e87-5625e5d72be0
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id8FA2:870C9:A2F738:E6CF04:6AFB5575
html-safe-nonced095f8baa78b4ee621c30842aca039d9d0b2949cc8d634f266eebafdb67763e1
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RkEyOjg3MEM5OkEyRjczODpFNkNGMDQ6NkFGQjU1NzUiLCJ2aXNpdG9yX2lkIjoiMzkxODY3OTA2MjU5OTEyODQzNyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac02b58e2bbc761d9b979d7dc01fb16a529c5c4b1ca5f7bcec97a950570f94fa35
hovercard-subject-tagpull_request:4860282428
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/9025/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, which replaced the per-workspace folder lock on about 15 workspace-file write paths with lockWorkspaceProject: an exclusive advisory lock on the whole Project (a workspa...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None7122bb414b542dba14d71a3f0b9f6fd2abce715b9f5912d082800563e6c806d1
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
releasecbf66c024bb6d10e6955baa7413c54cf13a201bb
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/simstudioai/sim/pull/9025/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F9025%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%2F9025%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/9025/files
Reloadhttps://github.com/simstudioai/sim/pull/9025/files
Reloadhttps://github.com/simstudioai/sim/pull/9025/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/project-lock-shared-writershttps://github.com/simstudioai/sim/tree/fix/project-lock-shared-writers
Conversation 10 https://github.com/simstudioai/sim/pull/9025
Commits 3 https://github.com/simstudioai/sim/pull/9025/commits
Checks 51 https://github.com/simstudioai/sim/pull/9025/checks
Files changed https://github.com/simstudioai/sim/pull/9025/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/9025/files
fix(projects): fence file writers with a shared Project lock https://github.com/simstudioai/sim/pull/9025/files#top
Show all changes 3 commits https://github.com/simstudioai/sim/pull/9025/files
219869d fix(projects): fence file writers with a shared Project lock waleedlatif1 Oct 14, 2026 https://github.com/simstudioai/sim/pull/9025/commits/219869de7d5bef3462d230273da9f62ebf57fbf0
b9e1f1d fix(files): lock the workspace row before bulk archive and folder res… waleedlatif1 Oct 14, 2026 https://github.com/simstudioai/sim/pull/9025/commits/b9e1f1d9df1565a4da5e1ba2d84fe22f74a06b6c
7096513 fix(files): lock the workspace row before path-based folder delete ar… waleedlatif1 Oct 14, 2026 https://github.com/simstudioai/sim/pull/9025/commits/70965138e6bc7d93cdb988451b673b10abbc7ac6
Clear filters https://github.com/simstudioai/sim/pull/9025/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/9025/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/9025/files
membership.ts https://github.com/simstudioai/sim/pull/9025/files#diff-35d231c60e4149571281467f303ecee4907da4dd3f21df2f5d39bdf687fdd9e6
payer-transfer.test.ts https://github.com/simstudioai/sim/pull/9025/files#diff-5e0f27d6e0c9ed5d01d96b543cdec85c5b4b5126d88b09a2df76a3577c1bb89d
payer-transfer.ts https://github.com/simstudioai/sim/pull/9025/files#diff-66f6f1ec81e3502fef82cb83982b15f172b097741c280edadef62ef919ac61b1
foundation.integration.ts https://github.com/simstudioai/sim/pull/9025/files#diff-6646cd0623dba354f194ac8ab09c15d5bdd91dcdf440e3245684c9588303231f
membership.ts https://github.com/simstudioai/sim/pull/9025/files#diff-443e24fbedbb7e5945ae105a87806279c2388bacadc6437e04fd695630271195
workspace-file-folder-manager.ts https://github.com/simstudioai/sim/pull/9025/files#diff-7ab6712e7e7b3b214000c022f68393bf7da60abb4ec2a557d5fa912f10c245cc
lifecycle.ts https://github.com/simstudioai/sim/pull/9025/files#diff-c61ccbb9c0d07f4cd332899533c64db1949d37c8b2af3b8573d6c42f9577b7bf
billing-payer-transfer.mock.ts https://github.com/simstudioai/sim/pull/9025/files#diff-92d933d0c87acae6ef3c80a5fa3327e67a62b55ad7ea8adad8bafc7fdef18158
apps/sim/lib/billing/organizations/membership.tshttps://github.com/simstudioai/sim/pull/9025/files#diff-35d231c60e4149571281467f303ecee4907da4dd3f21df2f5d39bdf687fdd9e6
View file https://github.com/simstudioai/sim/blob/70965138e6bc7d93cdb988451b673b10abbc7ac6/apps/sim/lib/billing/organizations/membership.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/9025/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/9025/files#diff-35d231c60e4149571281467f303ecee4907da4dd3f21df2f5d39bdf687fdd9e6
https://github.com/simstudioai/sim/pull/9025/files#diff-35d231c60e4149571281467f303ecee4907da4dd3f21df2f5d39bdf687fdd9e6
https://github.com/simstudioai/sim/pull/9025/files#diff-35d231c60e4149571281467f303ecee4907da4dd3f21df2f5d39bdf687fdd9e6
https://github.com/simstudioai/sim/pull/9025/files#diff-35d231c60e4149571281467f303ecee4907da4dd3f21df2f5d39bdf687fdd9e6
apps/sim/lib/billing/storage/payer-transfer.test.tshttps://github.com/simstudioai/sim/pull/9025/files#diff-5e0f27d6e0c9ed5d01d96b543cdec85c5b4b5126d88b09a2df76a3577c1bb89d
View file https://github.com/simstudioai/sim/blob/70965138e6bc7d93cdb988451b673b10abbc7ac6/apps/sim/lib/billing/storage/payer-transfer.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/9025/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/9025/files#diff-5e0f27d6e0c9ed5d01d96b543cdec85c5b4b5126d88b09a2df76a3577c1bb89d
https://github.com/simstudioai/sim/pull/9025/files#diff-5e0f27d6e0c9ed5d01d96b543cdec85c5b4b5126d88b09a2df76a3577c1bb89d
https://github.com/simstudioai/sim/pull/9025/files#diff-5e0f27d6e0c9ed5d01d96b543cdec85c5b4b5126d88b09a2df76a3577c1bb89d
https://github.com/simstudioai/sim/pull/9025/files#diff-5e0f27d6e0c9ed5d01d96b543cdec85c5b4b5126d88b09a2df76a3577c1bb89d
https://github.com/simstudioai/sim/pull/9025/files#diff-5e0f27d6e0c9ed5d01d96b543cdec85c5b4b5126d88b09a2df76a3577c1bb89d
https://github.com/simstudioai/sim/pull/9025/files#diff-5e0f27d6e0c9ed5d01d96b543cdec85c5b4b5126d88b09a2df76a3577c1bb89d
https://github.com/simstudioai/sim/pull/9025/files#diff-5e0f27d6e0c9ed5d01d96b543cdec85c5b4b5126d88b09a2df76a3577c1bb89d
https://github.com/simstudioai/sim/pull/9025/files#diff-5e0f27d6e0c9ed5d01d96b543cdec85c5b4b5126d88b09a2df76a3577c1bb89d
https://github.com/simstudioai/sim/pull/9025/files#diff-5e0f27d6e0c9ed5d01d96b543cdec85c5b4b5126d88b09a2df76a3577c1bb89d
https://github.com/simstudioai/sim/pull/9025/files#diff-5e0f27d6e0c9ed5d01d96b543cdec85c5b4b5126d88b09a2df76a3577c1bb89d
apps/sim/lib/billing/storage/payer-transfer.tshttps://github.com/simstudioai/sim/pull/9025/files#diff-66f6f1ec81e3502fef82cb83982b15f172b097741c280edadef62ef919ac61b1
View file https://github.com/simstudioai/sim/blob/70965138e6bc7d93cdb988451b673b10abbc7ac6/apps/sim/lib/billing/storage/payer-transfer.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/9025/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/9025/files#diff-66f6f1ec81e3502fef82cb83982b15f172b097741c280edadef62ef919ac61b1
https://github.com/simstudioai/sim/pull/9025/files#diff-66f6f1ec81e3502fef82cb83982b15f172b097741c280edadef62ef919ac61b1
https://github.com/simstudioai/sim/pull/9025/files#diff-66f6f1ec81e3502fef82cb83982b15f172b097741c280edadef62ef919ac61b1
https://github.com/simstudioai/sim/pull/9025/files#diff-66f6f1ec81e3502fef82cb83982b15f172b097741c280edadef62ef919ac61b1
https://github.com/simstudioai/sim/pull/9025/files#diff-66f6f1ec81e3502fef82cb83982b15f172b097741c280edadef62ef919ac61b1
https://github.com/simstudioai/sim/pull/9025/files#diff-66f6f1ec81e3502fef82cb83982b15f172b097741c280edadef62ef919ac61b1
https://github.com/simstudioai/sim/pull/9025/files#diff-66f6f1ec81e3502fef82cb83982b15f172b097741c280edadef62ef919ac61b1
https://github.com/simstudioai/sim/pull/9025/files#diff-66f6f1ec81e3502fef82cb83982b15f172b097741c280edadef62ef919ac61b1
https://github.com/simstudioai/sim/pull/9025/files#diff-66f6f1ec81e3502fef82cb83982b15f172b097741c280edadef62ef919ac61b1
https://github.com/simstudioai/sim/pull/9025/files#diff-66f6f1ec81e3502fef82cb83982b15f172b097741c280edadef62ef919ac61b1
https://github.com/simstudioai/sim/pull/9025/files#diff-66f6f1ec81e3502fef82cb83982b15f172b097741c280edadef62ef919ac61b1
https://github.com/simstudioai/sim/pull/9025/files#diff-66f6f1ec81e3502fef82cb83982b15f172b097741c280edadef62ef919ac61b1
https://github.com/simstudioai/sim/pull/9025/files#diff-66f6f1ec81e3502fef82cb83982b15f172b097741c280edadef62ef919ac61b1
https://github.com/simstudioai/sim/pull/9025/files#diff-66f6f1ec81e3502fef82cb83982b15f172b097741c280edadef62ef919ac61b1
https://github.com/simstudioai/sim/pull/9025/files#diff-66f6f1ec81e3502fef82cb83982b15f172b097741c280edadef62ef919ac61b1
Please reload this pagehttps://github.com/simstudioai/sim/pull/9025/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/9025/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.