Skip to content

Commit 01e8620

Browse files
committed
Prevent initializing a realtime stream on a completed run
1 parent faaed84 commit 01e8620

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

apps/webapp/app/routes/realtime.v1.streams.$runId.$target.$streamId.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,16 @@ const { action } = createActionApiRoute(
6868
},
6969
select: {
7070
realtimeStreamsVersion: true,
71+
completedAt: true,
7172
},
7273
});
7374

75+
if (updatedRun.completedAt) {
76+
return new Response("Cannot initialize a realtime stream on a completed run", {
77+
status: 400,
78+
});
79+
}
80+
7481
const realtimeStream = getRealtimeStreamInstance(
7582
authentication.environment,
7683
updatedRun.realtimeStreamsVersion

0 commit comments

Comments
 (0)