René's URL Explorer Experiment


Title: feat(admin): move a workspace between organizations by mzxchandra · Pull Request #7243 · simstudioai/sim · GitHub

Open Graph Title: feat(admin): move a workspace between organizations by mzxchandra · Pull Request #7243 · simstudioai/sim

X Title: feat(admin): move a workspace between organizations by mzxchandra · Pull Request #7243 · simstudioai/sim

Description: Summary Lets the admin panel move a workspace from one organization to another. The move was restricted to personal/grandfathered sources — assertWorkspaceMovable threw "Inter-organization workspace transfers are not supported" — so support could only re-home a workspace with manual SQL. Most of the machinery already existed: durable operation IDs, seat-capacity checks, and changeWorkspaceStoragePayerInTx, which already accepted an arbitrary source payer, so the storage-ledger rebalance between two orgs needed no change. The work is a guard relaxation plus handling what the source organization loses. Two invariants this feature could break, now enforced here Moving a workspace between organizations is the first operation in the product capable of separating an artifact from the org that owns it. Two invariants nothing has ever had to defend: A custom block and its bound workflow always share an organization. publishCustomBlock refuses a workflow outside the target org, so the pair has always been co-located. getCustomBlockAuthority resolves by the consumer's org, and admitCustomBlockChildExecution deliberately skips its concurrency reservation because "the consumer and source workspaces are always in the same organization". A stranded row would run a foreign tenant's workflow under its owner's credentials, billed to the wrong payer. The move unpublishes those blocks through the product's own deleteCustomBlock, and records CUSTOM_BLOCK_DELETED in the source org's audit view. A fork parent and child always share an organization. assertCanFork pins the child to the source's org and resolveForkEdge has no org check at all. The move refuses while a cross-org edge would result; the fork must be disconnected first. Three blockers Each is evaluated in preflight and re-checked inside the transaction, because a subscription can lapse, a fork can be created, and an invitation can arrive in between. Blocker Code Why Cross-org fork edge fork-lineage-conflict Unlinking destroys promote history irreversibly; that call belongs to the customer, not a support admin mid-dialog Live pending invitation pending-invitations-present Re-stamping an org-scoped invitation converts a pending membership in the source org into one in the destination, consuming a seat for an invitation the destination never issued. Expired invitations do not block Entitlement downgrade destination-entitlement-downgrade Silent capability loss with no cleanup available and no signal to affected users Blocking on invitations deleted the most intricate part of the design — no cross-org invitation migration, no intent resolver, no sibling-invitation creation. invitation-migration-plan.ts is untouched and the shipped personal→org invitation path is not modified at all. Concurrency Both organizations are now locked, ascending by id, mirroring acquireOrganizationUserMutationLocks. The source id is read optimistically before the transaction and re-verified under the locks, retrying through the existing loop via SourceOrganizationChangedError. Lock order is unchanged: invitation/workspace advisory locks → org locks → workspace row. Audit The workspace-scoped move entry resolves to the destination after the move, because buildOrgScopeCondition scopes org audit reads by the org's current workspaces. Without more, the org that lost the workspace would have no record. Adds an org-level entry (workspaceId: null + metadata.organizationId, that condition's other branch) so the loss is diagnosable from the side that incurred it. Type of Change New feature Testing Automated: full apps/sim suite — 37,306 tests across 2,669 files, zero failures. turbo run type-check clean across all 26 workspaces. check:api-validation:strict, check:boundaries, check:client-boundary, check:route-verbs, check:api-contract-routes, check:utils, check:import-specifiers, and the 39-audit check:audits bundle all pass. 11 new tests cover the org→org path: both org locks acquired in sorted order after the invitation locks and before the row lock; the payer transfer fenced on the source org read under those locks (the assertion that makes the whole move safe); each blocker refusing without mutating anything; custom blocks unpublished; the source-org audit entry landing in the source and not the destination; and the personal source path unchanged, as a regression fence. End to end against a real database, two orgs and a workspace with content on both sides. Verified: org-owned workspaces appear as candidates with their source org named; every blocker refuses and mutates nothing; the happy path re-homes org, payer, and organizationAssignedAt; the move is reversible; replaying an operationId is idempotent; and both invariant post-conditions hold (zero cross-org custom blocks, zero cross-org fork edges). E2E surfaced two defects the unit tests missed, both now with regression tests: getMovedWorkspaceSummary took an appliedContext parameter no call site passed, so every applied move reported sourceOrganization: null; and the source-org audit entries were specified but never implemented. Reviewers should focus on the lock ordering in moveWorkspaceToOrganization and the expectedCurrentPayer fence — that optimistic check is what makes the payer transfer safe under concurrency. 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) Notes for reviewers Not verifiable on a local deployment. resolveOrganizationEnterprisePlan short-circuits on isAccessControlEnabled && !isHosted, so every org resolves as entitled locally and the downgrade blocker cannot fire. That is correct — the gates it protects also all-pass there, so nothing is lost — but it means the blocker needs a hosted deployment to exercise. Related: isOrganizationOnEnterprisePlan is really "is on a paid org plan" (isOrgPlan = isTeam || isEnterprise), so Team is not a downgrade from Enterprise for these capabilities. The blocker reuses that same predicate deliberately, so it can never disagree with the gates it protects. Companion PR in simstudioai/admin adds the review modal that presents all of this before the admin confirms.

Open Graph Description: Summary Lets the admin panel move a workspace from one organization to another. The move was restricted to personal/grandfathered sources — assertWorkspaceMovable threw "Inter-organization wor...

X Description: Summary Lets the admin panel move a workspace from one organization to another. The move was restricted to personal/grandfathered sources — assertWorkspaceMovable threw "Inter-organization...

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

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:b2398d91-a6f4-d352-c5e4-5cec084a61c7
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idE62C:283A10:3C4D69:565C2B:6AFB3B7E
html-safe-nonce934786f611952865744a34ae1059abca6c240614755b1be8e01a8de122676ae3
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNjJDOjI4M0ExMDozQzRENjk6NTY1QzJCOjZBRkIzQjdFIiwidmlzaXRvcl9pZCI6IjIzMzIzNjA5MjA3NzgwOTU0ODYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac86e2c1483d868815e963adce2ab560bc580af1d881699d957a4e3026c09ce995
hovercard-subject-tagpull_request:4389056328
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/7243/files
twitter:imagehttps://avatars.githubusercontent.com/u/129460234?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/129460234?s=400&v=4
og:image:altSummary Lets the admin panel move a workspace from one organization to another. The move was restricted to personal/grandfathered sources — assertWorkspaceMovable threw "Inter-organization wor...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None2169b0dfbef67ed6b128074a5ed45bb7d5d1859783b10178b09a7765ad5f3693
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
release3b4fc8df5ef1c6757e733a23e6b81b6725021823
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/simstudioai/sim/pull/7243/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fsimstudioai%2Fsim%2Fpull%2F7243%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%2F7243%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/7243/files
Reloadhttps://github.com/simstudioai/sim/pull/7243/files
Reloadhttps://github.com/simstudioai/sim/pull/7243/files
simstudioaihttps://github.com/simstudioai
simhttps://github.com/simstudioai/sim
Codehttps://github.com/simstudioai/sim
Issues129 (129)https://github.com/simstudioai/sim/issues
Pull requests199 (199)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
mzxchandrahttps://github.com/mzxchandra
staginghttps://github.com/simstudioai/sim/tree/staging
feat/admin-org-to-org-workspace-movehttps://github.com/simstudioai/sim/tree/feat/admin-org-to-org-workspace-move
Conversation 123 https://github.com/simstudioai/sim/pull/7243
Commits 1 https://github.com/simstudioai/sim/pull/7243/commits
Checks 27 https://github.com/simstudioai/sim/pull/7243/checks
Files changed https://github.com/simstudioai/sim/pull/7243/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/7243/files
feat(admin): move a workspace between organizations https://github.com/simstudioai/sim/pull/7243/files#top
Show all changes 1 commit https://github.com/simstudioai/sim/pull/7243/files
2ac4d8a feat(admin): move a workspace between organizations mzxchandra Aug 29, 2026 https://github.com/simstudioai/sim/pull/7243/commits/2ac4d8affdff9755eba9544a64294d3dd6e6848a
Clear filters https://github.com/simstudioai/sim/pull/7243/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/7243/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/7243/files
create-fork.test.ts https://github.com/simstudioai/sim/pull/7243/files#diff-296e1a98029b9a96a81aa7f980262a8491ff20cccc8f94b9820b968ed932b189
create-fork.ts https://github.com/simstudioai/sim/pull/7243/files#diff-202ab0340bdbd94663e1182c0295106afbcba13ffa9f7e481276fee250b041ee
dashboard-workspaces.ts https://github.com/simstudioai/sim/pull/7243/files#diff-7718961cbbad076ba576ce19c35c863db3d8e3367524cfd71907ccbced36ceb8
subscription.ts https://github.com/simstudioai/sim/pull/7243/files#diff-ba28a867a18d2fec4e36fc5dea465c7dcfd8b755794a2e6ea72b0eec32fd99be
operations.ts https://github.com/simstudioai/sim/pull/7243/files#diff-62275746551c533d2f1fde5464bc8e91f8884813163e90d8a4c9e905c9ffa44f
admin-move-source-impact.ts https://github.com/simstudioai/sim/pull/7243/files#diff-f80f7f0e80868597705b5fc333751201785abe7fcfc010d38a62a7c300a23234
admin-move.test.ts https://github.com/simstudioai/sim/pull/7243/files#diff-6b85519a0f0b50bb3a96328ec5d00bab2376c14e12cbd79ed99ae4ff4b76a615
admin-move.ts https://github.com/simstudioai/sim/pull/7243/files#diff-21cb83908e161603e2963824ec195fc05d5b4963f93bdb3353996c4ea6d29a4d
apps/sim/ee/workspace-forking/lib/create-fork.test.tshttps://github.com/simstudioai/sim/pull/7243/files#diff-296e1a98029b9a96a81aa7f980262a8491ff20cccc8f94b9820b968ed932b189
View file https://github.com/simstudioai/sim/blob/2ac4d8affdff9755eba9544a64294d3dd6e6848a/apps/sim/ee/workspace-forking/lib/create-fork.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/7243/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/7243/files#diff-296e1a98029b9a96a81aa7f980262a8491ff20cccc8f94b9820b968ed932b189
https://github.com/simstudioai/sim/pull/7243/files#diff-296e1a98029b9a96a81aa7f980262a8491ff20cccc8f94b9820b968ed932b189
https://github.com/simstudioai/sim/pull/7243/files#diff-296e1a98029b9a96a81aa7f980262a8491ff20cccc8f94b9820b968ed932b189
https://github.com/simstudioai/sim/pull/7243/files#diff-296e1a98029b9a96a81aa7f980262a8491ff20cccc8f94b9820b968ed932b189
https://github.com/simstudioai/sim/pull/7243/files#diff-296e1a98029b9a96a81aa7f980262a8491ff20cccc8f94b9820b968ed932b189
apps/sim/ee/workspace-forking/lib/create-fork.tshttps://github.com/simstudioai/sim/pull/7243/files#diff-202ab0340bdbd94663e1182c0295106afbcba13ffa9f7e481276fee250b041ee
View file https://github.com/simstudioai/sim/blob/2ac4d8affdff9755eba9544a64294d3dd6e6848a/apps/sim/ee/workspace-forking/lib/create-fork.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/7243/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/7243/files#diff-202ab0340bdbd94663e1182c0295106afbcba13ffa9f7e481276fee250b041ee
https://github.com/simstudioai/sim/pull/7243/files#diff-202ab0340bdbd94663e1182c0295106afbcba13ffa9f7e481276fee250b041ee
https://github.com/simstudioai/sim/pull/7243/files#diff-202ab0340bdbd94663e1182c0295106afbcba13ffa9f7e481276fee250b041ee
https://github.com/simstudioai/sim/pull/7243/files#diff-202ab0340bdbd94663e1182c0295106afbcba13ffa9f7e481276fee250b041ee
apps/sim/lib/api/contracts/v1/admin/dashboard-workspaces.tshttps://github.com/simstudioai/sim/pull/7243/files#diff-7718961cbbad076ba576ce19c35c863db3d8e3367524cfd71907ccbced36ceb8
View file https://github.com/simstudioai/sim/blob/2ac4d8affdff9755eba9544a64294d3dd6e6848a/apps/sim/lib/api/contracts/v1/admin/dashboard-workspaces.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/7243/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/7243/files#diff-7718961cbbad076ba576ce19c35c863db3d8e3367524cfd71907ccbced36ceb8
Please reload this pagehttps://github.com/simstudioai/sim/pull/7243/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/7243/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/7243/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/7243/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/7243/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/7243/files
https://github.com/simstudioai/sim/pull/7243/files#diff-7718961cbbad076ba576ce19c35c863db3d8e3367524cfd71907ccbced36ceb8
https://github.com/simstudioai/sim/pull/7243/files#diff-7718961cbbad076ba576ce19c35c863db3d8e3367524cfd71907ccbced36ceb8
cubic-dev-aihttps://github.com/apps/cubic-dev-ai
Aug 29, 2026https://github.com/simstudioai/sim/pull/7243/files#r3885198634
Please reload this pagehttps://github.com/simstudioai/sim/pull/7243/files
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
https://www.cubic.dev/action/fix/violation/362d74d4-66be-4759-a2cd-ef790f0634c5
Please reload this pagehttps://github.com/simstudioai/sim/pull/7243/files
https://github.com/simstudioai/sim/pull/7243/files#diff-7718961cbbad076ba576ce19c35c863db3d8e3367524cfd71907ccbced36ceb8
apps/sim/lib/billing/core/subscription.tshttps://github.com/simstudioai/sim/pull/7243/files#diff-ba28a867a18d2fec4e36fc5dea465c7dcfd8b755794a2e6ea72b0eec32fd99be
View file https://github.com/simstudioai/sim/blob/2ac4d8affdff9755eba9544a64294d3dd6e6848a/apps/sim/lib/billing/core/subscription.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/simstudioai/sim/pull/7243/{{ revealButtonHref }}
https://github.com/simstudioai/sim/pull/7243/files#diff-ba28a867a18d2fec4e36fc5dea465c7dcfd8b755794a2e6ea72b0eec32fd99be
Please reload this pagehttps://github.com/simstudioai/sim/pull/7243/files
cubic-dev-aihttps://github.com/apps/cubic-dev-ai
Aug 29, 2026https://github.com/simstudioai/sim/pull/7243/files#r3885198627
Please reload this pagehttps://github.com/simstudioai/sim/pull/7243/files
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
https://www.cubic.dev/action/fix/violation/cdf93b3e-4002-4f8e-a0d3-93cc77b30690
Please reload this pagehttps://github.com/simstudioai/sim/pull/7243/files
https://github.com/simstudioai/sim/pull/7243/files#diff-ba28a867a18d2fec4e36fc5dea465c7dcfd8b755794a2e6ea72b0eec32fd99be
Please reload this pagehttps://github.com/simstudioai/sim/pull/7243/files
Please reload this pagehttps://github.com/simstudioai/sim/pull/7243/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.