René's URL Explorer Experiment


Title: fix(credentials): write an env value and its credential row together by waleedlatif1 · Pull Request #7160 · simstudioai/sim · GitHub

Open Graph Title: fix(credentials): write an env value and its credential row together by waleedlatif1 · Pull Request #7160 · simstudioai/sim

X Title: fix(credentials): write an env value and its credential row together by waleedlatif1 · Pull Request #7160 · simstudioai/sim

Description: Summary Three fixes found by tracing review findings on the release PR back to their source. Lost update. Every writer of a workspace or personal environment map read-modify-writes one jsonb column, so they take an advisory lock to serialize. deleteCredentialRecord took none and ran outside a transaction, so a secret written concurrently was read before that write and silently dropped by the write-back. Value and row written apart. The credential row was written after its map transaction committed, in four places. The delete direction left a row describing a value that was gone. The create direction is worse than a stale row because retrying cannot repair it — the key is in the map by then, so the next attempt reads it as pre-existing, computes an empty newKeys, and never creates the row. Both helpers already accept executor, and setWorkspaceSecret has passed the transaction since that parameter landed; these four were never migrated. Folded the four copies of the lock into one helper, since this would have been the fifth. Silent block drop. workflow_blocks.name is NOT NULL so a block missing type/name has to be dropped, but it was dropped with no warning and no log line — a block with no edges vanished without a trace. The client sanitizer warns on the identical condition; this adds its server counterpart, into a warnings array the internal PUT, the v2 write and the importer already return. Unread transcript. Nothing caps a chat transcript, and the v2 chat route keys continuity by chatId, so it loaded the whole thing on every resumed turn and discarded it. Opt out there; the load stays the default because the copilot send path does consume it. The personal reconcile deliberately stays outside its transaction — it opens its own and takes the user-identity fence, so nesting it would have two transactions taking two locks in opposite orders. It reconciles against the stored keys, so a failure there is repaired by the next one rather than entrenched. Type of Change Bug fix Testing bun run lint, bun run check:audits (36/36), tsc --noEmit, and the affected suites (6045 tests). New assertions mutation-tested: removing the workspace lock, the personal lock, or executor: tx each turns exactly one test red. 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 Three fixes found by tracing review findings on the release PR back to their source. Lost update. Every writer of a workspace or personal environment map read-modify-writes one jsonb colum...

X Description: Summary Three fixes found by tracing review findings on the release PR back to their source. Lost update. Every writer of a workspace or personal environment map read-modify-writes one jsonb colum...

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

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:a18e71be-d4cd-9f60-5ca6-f6bf685cf5c7
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idD7F6:B90C4:29BA0:3A662:6AFB2703
html-safe-nonce34978fd584df2b49e51e02ef09c7c7ee06ae0cff7fdf3c896dd882fe196d4c46
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEN0Y2OkI5MEM0OjI5QkEwOjNBNjYyOjZBRkIyNzAzIiwidmlzaXRvcl9pZCI6IjEwMzE5OTQyNzU1MjYyODkxNTUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmace87d09aae64c331138eef161f976594656c29672d90ad05ec95600a96854697f
hovercard-subject-tagpull_request:4373204308
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/7160/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 Three fixes found by tracing review findings on the release PR back to their source. Lost update. Every writer of a workspace or personal environment map read-modify-writes one jsonb colum...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None40c7ffe00e8bbb3ca8403c83d7ef110379c9eba2cbc7a7c333b037ffd940d4e4
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
releasef494d77c37809e03e18d49c6e9945c57e0b64070
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/simstudioai/sim/pull/7160/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F7160%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%2F7160%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/7160/files
Reloadhttps://github.com/simstudioai/sim/pull/7160/files
Reloadhttps://github.com/simstudioai/sim/pull/7160/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/env-credential-consistencyhttps://github.com/simstudioai/sim/tree/fix/env-credential-consistency
Conversation 9 https://github.com/simstudioai/sim/pull/7160
Commits 5 https://github.com/simstudioai/sim/pull/7160/commits
Checks 29 https://github.com/simstudioai/sim/pull/7160/checks
Files changed https://github.com/simstudioai/sim/pull/7160/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/7160/files
fix(credentials): write an env value and its credential row together https://github.com/simstudioai/sim/pull/7160/files#top
Show all changes 5 commits https://github.com/simstudioai/sim/pull/7160/files
0a5bc43 fix(credentials): write an env value and its credential row together waleedlatif1 Aug 27, 2026 https://github.com/simstudioai/sim/pull/7160/commits/0a5bc435640ff68ac96f4bf0f901d30b4ec86320
a62dd79 fix(workflows): say when a block is dropped before persistence waleedlatif1 Aug 27, 2026 https://github.com/simstudioai/sim/pull/7160/commits/a62dd795d4ecc941fb58ec778e00b3e47d120acb
29db915 improvement(chat): stop loading a transcript the v2 route never reads waleedlatif1 Aug 27, 2026 https://github.com/simstudioai/sim/pull/7160/commits/29db9159b09c34fe26515c6480c87e1b6a04695c
5c4dbed fix(credentials): serialize every personal env map writer waleedlatif1 Aug 27, 2026 https://github.com/simstudioai/sim/pull/7160/commits/5c4dbed1e096a70759ad63440d4a43c1199bfa77
d7b1874 fix(credentials): chunk the credential-ACL write the env save now dep… waleedlatif1 Aug 27, 2026 https://github.com/simstudioai/sim/pull/7160/commits/d7b1874b1a4cb44044167f40fbd8403ed1797e98
Clear filters https://github.com/simstudioai/sim/pull/7160/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/7160/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/7160/files
route.ts https://github.com/simstudioai/sim/pull/7160/files#diff-1205085c630483ac4cc07c5532fe2660cb274e9362214885b9f634e334a4fb09
route.ts https://github.com/simstudioai/sim/pull/7160/files#diff-49f4588cde29933982c91f01ab1edcdf188cdd3002901d6cdef8dfc2fd60810d
route.ts https://github.com/simstudioai/sim/pull/7160/files#diff-9e3aa26aeda436f3d655aaed0ef3cf62fc88c2cb79e9006109f75f93dc459158
lifecycle.ts https://github.com/simstudioai/sim/pull/7160/files#diff-412bf431f927ecc34ee4bd1cd7f089b212399fd692c0640e70d2bed4d5a8917d
env-locks.ts https://github.com/simstudioai/sim/pull/7160/files#diff-8ad7fc5ed001cf6b28ae0283af4cdaf87116b4e26860ec3975e585aaf6b9b6a0
environment.test.ts https://github.com/simstudioai/sim/pull/7160/files#diff-5633f2362c7aaaa6fe2b7d5e1a6babe0e1069dc97c1de527187e2fe0811bd452
environment.ts https://github.com/simstudioai/sim/pull/7160/files#diff-410fe6b2c7c0fdce4b2c736619f349af53cf8e7f7a227f0a7b1565283b7dde10
index.test.ts https://github.com/simstudioai/sim/pull/7160/files#diff-97e5e31aa58873f3e1388f92be70dd82af42cfc2123fbb818d20bffe5eed6e69
index.ts https://github.com/simstudioai/sim/pull/7160/files#diff-2fc2e4aa7edc1851a28264eadfca64761f021e141a2cfced411e9a506929c612
secret-values.ts https://github.com/simstudioai/sim/pull/7160/files#diff-34f6088f9e6b562a69af3c6c81522ea563670efc841adc39a1f26ae048e39bcd
utils.ts https://github.com/simstudioai/sim/pull/7160/files#diff-aeda815ec30138a019eae8605afa0860a3c98f60a1b0b85c28e2709b478434d6
prepare-state.test.ts https://github.com/simstudioai/sim/pull/7160/files#diff-8bba28535d2b8ef444c1edf1e5fe6183457aa9416578955ee4829d2a55be1c1e
prepare-state.ts https://github.com/simstudioai/sim/pull/7160/files#diff-f056a30f439e1a3475f1ac6f8c309ec982dbe389082c5e0331dce2c03b52f18a
apps/sim/app/api/environment/route.tshttps://github.com/simstudioai/sim/pull/7160/files#diff-1205085c630483ac4cc07c5532fe2660cb274e9362214885b9f634e334a4fb09
View file https://github.com/simstudioai/sim/blob/d7b1874b1a4cb44044167f40fbd8403ed1797e98/apps/sim/app/api/environment/route.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/7160/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/7160/files#diff-1205085c630483ac4cc07c5532fe2660cb274e9362214885b9f634e334a4fb09
https://github.com/simstudioai/sim/pull/7160/files#diff-1205085c630483ac4cc07c5532fe2660cb274e9362214885b9f634e334a4fb09
https://github.com/simstudioai/sim/pull/7160/files#diff-1205085c630483ac4cc07c5532fe2660cb274e9362214885b9f634e334a4fb09
https://github.com/simstudioai/sim/pull/7160/files#diff-1205085c630483ac4cc07c5532fe2660cb274e9362214885b9f634e334a4fb09
apps/sim/app/api/v2/chat/route.tshttps://github.com/simstudioai/sim/pull/7160/files#diff-49f4588cde29933982c91f01ab1edcdf188cdd3002901d6cdef8dfc2fd60810d
View file https://github.com/simstudioai/sim/blob/d7b1874b1a4cb44044167f40fbd8403ed1797e98/apps/sim/app/api/v2/chat/route.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/7160/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/7160/files#diff-49f4588cde29933982c91f01ab1edcdf188cdd3002901d6cdef8dfc2fd60810d
https://github.com/simstudioai/sim/pull/7160/files#diff-49f4588cde29933982c91f01ab1edcdf188cdd3002901d6cdef8dfc2fd60810d
apps/sim/app/api/workspaces/[id]/environment/route.tshttps://github.com/simstudioai/sim/pull/7160/files#diff-9e3aa26aeda436f3d655aaed0ef3cf62fc88c2cb79e9006109f75f93dc459158
View file https://github.com/simstudioai/sim/blob/d7b1874b1a4cb44044167f40fbd8403ed1797e98/apps/sim/app/api/workspaces/%5Bid%5D/environment/route.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/7160/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/7160/files#diff-9e3aa26aeda436f3d655aaed0ef3cf62fc88c2cb79e9006109f75f93dc459158
https://github.com/simstudioai/sim/pull/7160/files#diff-9e3aa26aeda436f3d655aaed0ef3cf62fc88c2cb79e9006109f75f93dc459158
https://github.com/simstudioai/sim/pull/7160/files#diff-9e3aa26aeda436f3d655aaed0ef3cf62fc88c2cb79e9006109f75f93dc459158
https://github.com/simstudioai/sim/pull/7160/files#diff-9e3aa26aeda436f3d655aaed0ef3cf62fc88c2cb79e9006109f75f93dc459158
https://github.com/simstudioai/sim/pull/7160/files#diff-9e3aa26aeda436f3d655aaed0ef3cf62fc88c2cb79e9006109f75f93dc459158
https://github.com/simstudioai/sim/pull/7160/files#diff-9e3aa26aeda436f3d655aaed0ef3cf62fc88c2cb79e9006109f75f93dc459158
https://github.com/simstudioai/sim/pull/7160/files#diff-9e3aa26aeda436f3d655aaed0ef3cf62fc88c2cb79e9006109f75f93dc459158
https://github.com/simstudioai/sim/pull/7160/files#diff-9e3aa26aeda436f3d655aaed0ef3cf62fc88c2cb79e9006109f75f93dc459158
https://github.com/simstudioai/sim/pull/7160/files#diff-9e3aa26aeda436f3d655aaed0ef3cf62fc88c2cb79e9006109f75f93dc459158
https://github.com/simstudioai/sim/pull/7160/files#diff-9e3aa26aeda436f3d655aaed0ef3cf62fc88c2cb79e9006109f75f93dc459158
https://github.com/simstudioai/sim/pull/7160/files#diff-9e3aa26aeda436f3d655aaed0ef3cf62fc88c2cb79e9006109f75f93dc459158
https://github.com/simstudioai/sim/pull/7160/files#diff-9e3aa26aeda436f3d655aaed0ef3cf62fc88c2cb79e9006109f75f93dc459158
apps/sim/lib/copilot/chat/lifecycle.tshttps://github.com/simstudioai/sim/pull/7160/files#diff-412bf431f927ecc34ee4bd1cd7f089b212399fd692c0640e70d2bed4d5a8917d
View file https://github.com/simstudioai/sim/blob/d7b1874b1a4cb44044167f40fbd8403ed1797e98/apps/sim/lib/copilot/chat/lifecycle.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/7160/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/7160/files#diff-412bf431f927ecc34ee4bd1cd7f089b212399fd692c0640e70d2bed4d5a8917d
https://github.com/simstudioai/sim/pull/7160/files#diff-412bf431f927ecc34ee4bd1cd7f089b212399fd692c0640e70d2bed4d5a8917d
https://github.com/simstudioai/sim/pull/7160/files#diff-412bf431f927ecc34ee4bd1cd7f089b212399fd692c0640e70d2bed4d5a8917d
https://github.com/simstudioai/sim/pull/7160/files#diff-412bf431f927ecc34ee4bd1cd7f089b212399fd692c0640e70d2bed4d5a8917d
apps/sim/lib/credentials/env-locks.tshttps://github.com/simstudioai/sim/pull/7160/files#diff-8ad7fc5ed001cf6b28ae0283af4cdaf87116b4e26860ec3975e585aaf6b9b6a0
View file https://github.com/simstudioai/sim/blob/d7b1874b1a4cb44044167f40fbd8403ed1797e98/apps/sim/lib/credentials/env-locks.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/7160/{{ revealButtonHref }}
Please reload this pagehttps://github.com/simstudioai/sim/pull/7160/files
apps/sim/lib/credentials/environment.test.tshttps://github.com/simstudioai/sim/pull/7160/files#diff-5633f2362c7aaaa6fe2b7d5e1a6babe0e1069dc97c1de527187e2fe0811bd452
View file https://github.com/simstudioai/sim/blob/d7b1874b1a4cb44044167f40fbd8403ed1797e98/apps/sim/lib/credentials/environment.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/7160/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/7160/files#diff-5633f2362c7aaaa6fe2b7d5e1a6babe0e1069dc97c1de527187e2fe0811bd452
https://github.com/simstudioai/sim/pull/7160/files#diff-5633f2362c7aaaa6fe2b7d5e1a6babe0e1069dc97c1de527187e2fe0811bd452
https://github.com/simstudioai/sim/pull/7160/files#diff-5633f2362c7aaaa6fe2b7d5e1a6babe0e1069dc97c1de527187e2fe0811bd452
Please reload this pagehttps://github.com/simstudioai/sim/pull/7160/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/7160/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.