Skip to content

Commit c185ff1

Browse files
icecrasher321claude
andcommitted
fix(deploy): keep the workspace-id resolver module-private
A mechanical edit stranded an `export` onto `resolveWorkspaceId` and stripped it from `DeploymentStateRow`. It type-checked because the call sites pass the row structurally, so nothing caught it. The export is the part that matters: this helper queries the global pool, so calling it inside a transaction callback is exactly the nested checkout the tripwire throws on — and exporting it invited a caller to do that from somewhere already holding a connection. That widened the surface the previous commit narrowed by making `materializeDeploymentState` require a `workspaceId`. `DeploymentStateRow` stays unexported: nothing imports it, and the call sites satisfy it structurally. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 9a199c3 commit c185ff1

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

  • apps/sim/lib/workflows/persistence

apps/sim/lib/workflows/persistence/utils.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,12 @@ export function invalidateDeployedStateCache(deploymentVersionId?: string): void
145145
deployedStateCache.clear()
146146
}
147147

148-
export /**
149-
* Only for entry points that are NOT inside a transaction — it checks out a
150-
* connection of its own.
148+
/**
149+
* Deliberately module-private: it queries the global pool, so calling it inside
150+
* a transaction callback is the nested checkout `packages/db/tx-tripwire.ts`
151+
* throws on. Keeping it unexported is what stops a future caller reaching for it
152+
* from somewhere that already holds a connection — the same reasoning that made
153+
* `materializeDeploymentState` take a `workspaceId` instead of resolving one.
151154
*/
152155
async function resolveWorkspaceId(workflowId: string, provided?: string): Promise<string> {
153156
if (provided) return provided

0 commit comments

Comments
 (0)