You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(workspaces): apply /simplify review — invert stranded-provisioning to opt-in
Per multi-angle simplify/altitude review of the auto-provisioning fix:
- archiveWorkspace's stranded-member handling is now opt-in
(provisionFallbackForStrandedMembers, default off) instead of opt-out
(force). A future caller of archiveWorkspace that doesn't know about
this feature now gets the safe default (no side-effect workspace
creation) rather than having to remember to pass force: true. Kept
the logic inside archiveWorkspace's single transaction rather than
splitting into two composable functions, since that would either
reintroduce the TOCTOU race (separate transactions) or require
threading an external tx through archiveWorkspace (bigger, riskier
change for uncertain benefit).
- provisionedWorkspaceUserIds is now returned from the transaction
callback instead of mutated via an outer `let`.
- Deduplicated CreateWorkspaceParams in app/api/workspaces/route.ts —
now Omit<CreateWorkspaceRecordParams, 'executor'> instead of a
hand-copied interface that could drift from the shared type.
- Added a comment at the createWorkspaceRecord call site in
archiveWorkspace noting it intentionally bypasses
getWorkspaceCreationPolicy (system-provisioned safety net, not user
self-service).
- Renamed a colliding local test helper (createTx used for two
different mock shapes in adjacent lib/workspaces test files).
disableUserResources (ban flow) no longer needs a flag at all — the
default now matches its existing behavior.
description: `Auto-created replacement workspace "${fallbackWorkspace.name}" for a member left with no workspace after deleting "${workspaceRecord.name}"`,
description: `Auto-created replacement workspace "${fallbackWorkspace.name}" for a member left with no workspace after deleting "${workspaceRecord.name}"`,
0 commit comments