René's URL Explorer Experiment


Title: fix(realtime): keep admin block locks out of write-role graph replaces by waleedlatif1 · Pull Request #10062 · simstudioai/sim · GitHub

Open Graph Title: fix(realtime): keep admin block locks out of write-role graph replaces by waleedlatif1 · Pull Request #10062 · simstudioai/sim

X Title: fix(realtime): keep admin block locks out of write-role graph replaces by waleedlatif1 · Pull Request #10062 · simstudioai/sim

Description: Summary Block lock/unlock is admin-only (batch-toggle-locked), but write-role batch-add-blocks and replace-state over the socket, plus every HTTP state replace (PUT /api/workflows/[id]/state, v2 PUT .../state, Copilot apply-operations), wrote workflow_blocks.locked straight from the payload, so a write member could clear a lock and then edit or delete the block New pure preserveProtectedWorkflowBlocks in @sim/workflow-types: during a full replace, blocks protected in the stored graph (locked or inside a locked container) are kept exactly as stored along with their incoming edges, every other block is written unlocked, and incoming blocks nested under a locked ancestor are dropped. Blocks are keyed by block.id, never the record key Applied in realtime REPLACE_STATE (which also keeps a locked container's stored loop/parallel config) and in replaceWorkflowNormalizedState, the single door all HTTP replaces go through BATCH_ADD_BLOCKS now skips blocks that are protected or nested under a protected ancestor (was: direct parent only) and never writes locked, on insert or on conflict BATCH_ADD_BLOCKS loops/parallels and SUBFLOW_OPERATIONS.UPDATE skip protected containers, so a locked loop/parallel's config can't be rewritten (the editor already refuses edits to locked blocks) When persistence keeps lock-protected state over a replace-state/batch-add-blocks payload, persistWorkflowOperation returns reconcile: true and the handler emits the existing workflow-updated to the whole room (sender included) instead of broadcasting the rejected payload, so every client reloads the stored graph saveWorkflowToNormalizedTables is unchanged on purpose: import, fork, duplicate and the admin-only revert legitimately carry lock state into the graphs they write, and none of them is a write-role overwrite of an existing workflow Type of Change Bug fix Testing apps/realtime/src/database/block-lock.integration.ts (5) and apps/sim/lib/workflows/persistence/block-lock.integration.ts (1) against real Postgres: all 4 fail on the pre-fix code and pass with the fix; reverting the ancestor-parent guard, the nested-block drop, and the stored-subflow merge one at a time each turns its own test red; same for the loop-config filter, the subflow-update guard and the reconcile signal (an ordinary add asserts reconcile: false) apps/realtime database/operations.test.ts + handlers/operations.test.ts, apps/sim replace-normalized-state.test.ts, type-check for apps/realtime and packages/workflow-types, biome, check:boundaries, check:file-names, check:comment-hygiene, check:test-patterns, check:utils, check:explicit-any (baseline shrunk by 2) 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)

Open Graph Description: Summary Block lock/unlock is admin-only (batch-toggle-locked), but write-role batch-add-blocks and replace-state over the socket, plus every HTTP state replace (PUT /api/workflows/[id]/state, v2 P...

X Description: Summary Block lock/unlock is admin-only (batch-toggle-locked), but write-role batch-add-blocks and replace-state over the socket, plus every HTTP state replace (PUT /api/workflows/[id]/state, v2 P...

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

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:11abd495-e81e-ef1b-a61f-ad335594b0f7
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idDD2C:72699:6AD1C9:962EF1:6AFB6485
html-safe-noncefedd2c335da3eb48267d0f6dd61ba93505cabbde1d2233217379519b64bf4e1c
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERDJDOjcyNjk5OjZBRDFDOTo5NjJFRjE6NkFGQjY0ODUiLCJ2aXNpdG9yX2lkIjoiNjQyODgwMDU1MTg4NTY5NDA4NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac0325feefcd964609ef40ca1dc38f34987e1d0f217cc78f4f1d72620ce915a9b3
hovercard-subject-tagpull_request:5316793683
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/10062/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 Block lock/unlock is admin-only (batch-toggle-locked), but write-role batch-add-blocks and replace-state over the socket, plus every HTTP state replace (PUT /api/workflows/[id]/state, v2 P...
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/10062/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F10062%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%2F10062%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/10062/files
Reloadhttps://github.com/simstudioai/sim/pull/10062/files
Reloadhttps://github.com/simstudioai/sim/pull/10062/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/block-lock-bypasshttps://github.com/simstudioai/sim/tree/fix/block-lock-bypass
Conversation 36 https://github.com/simstudioai/sim/pull/10062
Commits 4 https://github.com/simstudioai/sim/pull/10062/commits
Checks 84 https://github.com/simstudioai/sim/pull/10062/checks
Files changed https://github.com/simstudioai/sim/pull/10062/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/10062/files
fix(realtime): keep admin block locks out of write-role graph replaces https://github.com/simstudioai/sim/pull/10062/files#top
Show all changes 4 commits https://github.com/simstudioai/sim/pull/10062/files
b59f210 fix(realtime): keep admin block locks out of write-role graph replaces waleedlatif1 Nov 14, 2026 https://github.com/simstudioai/sim/pull/10062/commits/b59f210a4add3c453c73d8bc3e13c2678a18fe4e
44dbf28 fix(realtime): guard locked loop config and re-sync clients when lock… waleedlatif1 Nov 14, 2026 https://github.com/simstudioai/sim/pull/10062/commits/44dbf28f9ab805d5302567d987845d29fcedefe0
cac9713 fix(realtime): cascade orphaned locked children and keep preserved ed… waleedlatif1 Nov 14, 2026 https://github.com/simstudioai/sim/pull/10062/commits/cac97139f674831b724fada425ad3d4bb9436abe
f2f0c41 fix(realtime): refuse whole pasted subtrees under a locked ancestor waleedlatif1 Nov 14, 2026 https://github.com/simstudioai/sim/pull/10062/commits/f2f0c41a5eb1a760761a4647764f0265bbca8234
Clear filters https://github.com/simstudioai/sim/pull/10062/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/10062/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/10062/files
block-lock.integration.ts https://github.com/simstudioai/sim/pull/10062/files#diff-30b989fb856794e76ae98af22a7a2aeebda6c0216b3d0de59b488074f008c3d8
operations.test.ts https://github.com/simstudioai/sim/pull/10062/files#diff-7325da1e147963f0023dc5b719e09d029cc18731b15b417e2844162c9561443d
operations.ts https://github.com/simstudioai/sim/pull/10062/files#diff-e8428fa80ec5afb5442d2c399ae8dccd54ba450b45cbaae13a15c833911be725
operations.test.ts https://github.com/simstudioai/sim/pull/10062/files#diff-f6edae6d2295dd723f942192148d7362f73d7fe4c9a31693b6f1bc411b9af45e
operations.ts https://github.com/simstudioai/sim/pull/10062/files#diff-8118483fbc555f221d9430e8d3b256aa70da2aa2b2f53d71d7cbd09206c57869
block-lock.integration.ts https://github.com/simstudioai/sim/pull/10062/files#diff-b0079647d2588b0381a198fb8e4e40a7e32eb5e34ae8c27fd689598a4e0c1603
replace-normalized-state.test.ts https://github.com/simstudioai/sim/pull/10062/files#diff-3bc885c52a4b3d3599e544196ffe97f033d0bd06b087f54e14aa2ea175bb0106
replace-normalized-state.ts https://github.com/simstudioai/sim/pull/10062/files#diff-0e534903cd494f4d5ad75d5647a832b1f9c50622fb69f80751a992734577ca96
workflow.ts https://github.com/simstudioai/sim/pull/10062/files#diff-d22956d2a7d110ae0ae7f6ee45dd7504260eecd01b38feb8bd0b6e05779eb2a5
check-explicit-any.baseline.json https://github.com/simstudioai/sim/pull/10062/files#diff-780d04116ec981737479435cdb0364b49047711f2dfb93b671a9be50a1b0bb27
apps/realtime/src/database/block-lock.integration.tshttps://github.com/simstudioai/sim/pull/10062/files#diff-30b989fb856794e76ae98af22a7a2aeebda6c0216b3d0de59b488074f008c3d8
View file https://github.com/simstudioai/sim/blob/f2f0c41a5eb1a760761a4647764f0265bbca8234/apps/realtime/src/database/block-lock.integration.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/10062/{{ revealButtonHref }}
apps/realtime/src/database/operations.test.tshttps://github.com/simstudioai/sim/pull/10062/files#diff-7325da1e147963f0023dc5b719e09d029cc18731b15b417e2844162c9561443d
View file https://github.com/simstudioai/sim/blob/f2f0c41a5eb1a760761a4647764f0265bbca8234/apps/realtime/src/database/operations.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/10062/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/10062/files#diff-7325da1e147963f0023dc5b719e09d029cc18731b15b417e2844162c9561443d
https://github.com/simstudioai/sim/pull/10062/files#diff-7325da1e147963f0023dc5b719e09d029cc18731b15b417e2844162c9561443d
https://github.com/simstudioai/sim/pull/10062/files#diff-7325da1e147963f0023dc5b719e09d029cc18731b15b417e2844162c9561443d
https://github.com/simstudioai/sim/pull/10062/files#diff-7325da1e147963f0023dc5b719e09d029cc18731b15b417e2844162c9561443d
Please reload this pagehttps://github.com/simstudioai/sim/pull/10062/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/10062/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.