Skip to content

Commit c36fecb

Browse files
committed
fix(webapp): gate the session run's version on the basin the run will carry
The run is created with the organization's basin, and run-scoped stream routes resolve their basin from the run alone. The session's own basin never enters that path, so gating the version on it can stamp a run v2 whose basin resolves to nothing, and every stream operation on that run then throws for its whole life. Reverts to the organization basin, which is the value the run is actually created with. Where an organization has been deprovisioned, its sessions keep serving v2 channels from their pinned basin while newly triggered runs degrade to v1, which still works, rather than failing outright.
1 parent afaf3b4 commit c36fecb

1 file changed

Lines changed: 4 additions & 17 deletions

File tree

apps/webapp/app/services/realtime/sessionRunManager.server.ts

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,7 @@ type EnsureRunForSessionParams = {
5252
*/
5353
session: Pick<
5454
Session,
55-
| "id"
56-
| "friendlyId"
57-
| "taskIdentifier"
58-
| "triggerConfig"
59-
| "currentRunId"
60-
| "currentRunVersion"
61-
| "streamBasinName"
55+
"id" | "friendlyId" | "taskIdentifier" | "triggerConfig" | "currentRunId" | "currentRunVersion"
6256
>;
6357
environment: AuthenticatedEnvironment;
6458
reason: EnsureRunReason;
@@ -241,7 +235,6 @@ export async function ensureRunForSession(
241235
triggerConfig: true,
242236
currentRunId: true,
243237
currentRunVersion: true,
244-
streamBasinName: true,
245238
},
246239
});
247240

@@ -291,7 +284,7 @@ export async function ensureRunForSession(
291284
* degrades to v1 where v2 streams are not configured.
292285
*/
293286
async function triggerSessionRun(params: {
294-
session: Pick<Session, "id" | "taskIdentifier" | "streamBasinName">;
287+
session: Pick<Session, "id" | "taskIdentifier">;
295288
config: SessionTriggerConfig;
296289
environment: AuthenticatedEnvironment;
297290
payloadOverrides?: Record<string, unknown>;
@@ -326,7 +319,7 @@ async function triggerSessionRun(params: {
326319
triggerAction: "trigger",
327320
realtimeStreamsVersion: determineRealtimeStreamsVersion(
328321
"v2",
329-
session.streamBasinName ?? environment.organization.streamBasinName
322+
environment.organization.streamBasinName
330323
),
331324
});
332325

@@ -348,13 +341,7 @@ type SwapSessionRunParams = {
348341
*/
349342
session: Pick<
350343
Session,
351-
| "id"
352-
| "friendlyId"
353-
| "taskIdentifier"
354-
| "triggerConfig"
355-
| "currentRunId"
356-
| "currentRunVersion"
357-
| "streamBasinName"
344+
"id" | "friendlyId" | "taskIdentifier" | "triggerConfig" | "currentRunId" | "currentRunVersion"
358345
>;
359346
/**
360347
* The run requesting the swap. Optimistic claim requires

0 commit comments

Comments
 (0)