We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3c401f8 commit fe24fe1Copy full SHA for fe24fe1
1 file changed
apps/web/src/features/workspace/workspace-sync-hooks.ts
@@ -352,6 +352,10 @@ export const useWorkspaceTransportSync = ({
352
const unsubscribe = subscribeWsConnectionState(({ kind }) => {
353
if ((kind !== "connected" && kind !== "reconnected") || !bootstrapReady) return;
354
void resyncWorkspaceSnapshots(kind === "reconnected");
355
+ // Discard any stale chunks from the old connection before attaching on reconnect.
356
+ if (kind === "reconnected") {
357
+ drainPendingStreamIndex(pendingStreamIndexRef.current);
358
+ }
359
// Attach terminal channel for each session so the server sends replay + live output.
360
const currentState = stateRefLatest.current;
361
for (const tab of currentState.tabs) {
0 commit comments