@@ -27,8 +27,7 @@ import { listAccessibleWorkspaceRowsForUser } from '@/lib/workspaces/utils'
2727
2828const logger = createLogger ( 'WorkspaceLifecycle' )
2929
30- /** Fallback workspace name for a member auto-provisioned a replacement — matches the
31- * pre-existing "you have no workspaces" client-side recovery naming for consistency. */
30+ /** Matches the pre-existing "you have no workspaces" client-side recovery naming. */
3231const FALLBACK_WORKSPACE_NAME = 'My Workspace'
3332
3433interface ArchiveWorkspaceOptions {
@@ -106,11 +105,10 @@ export async function archiveWorkspace(
106105 . from ( workflowMcpServer )
107106 . where ( eq ( workflowMcpServer . workspaceId , workspaceId ) )
108107
109- // serializable: without it, two concurrent deletions of different workspaces shared by the
110- // same sole member could each read a pre-deletion workspace count, both conclude the member
111- // isn't stranded, and together leave them with zero workspaces without either provisioning a
112- // replacement. Postgres detects this write skew under serializable isolation and aborts one
113- // transaction. Skipped when force is set, since that path never runs this check at all.
108+ // serializable: without it, two concurrent deletions sharing a sole member could each read a
109+ // pre-deletion workspace count and both skip provisioning a replacement. Postgres detects this
110+ // write skew under serializable isolation and aborts one transaction. Skipped when force is
111+ // set, since that path never runs the stranded-member check at all.
114112 const transactionConfig = options . force
115113 ? undefined
116114 : ( { isolationLevel : 'serializable' } as const )
0 commit comments