Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .changeset/clear-stream-timeout.md

This file was deleted.

1 change: 0 additions & 1 deletion contributors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,6 @@
- maximevtush
- maxpou
- mcansh
- mcollina
- MeatSim
- MenouerBetty
- Methuselah96
Expand Down
6 changes: 1 addition & 5 deletions packages/react-router/lib/server-runtime/single-fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -385,14 +385,10 @@ export function encodeViaTurboStream(
() => controller.abort(new Error("Server Timeout")),
typeof streamTimeout === "number" ? streamTimeout : 4950,
);

let clearStreamTimeout = () => clearTimeout(timeoutId);

requestSignal.addEventListener("abort", clearStreamTimeout);
requestSignal.addEventListener("abort", () => clearTimeout(timeoutId));

return encode(data, {
signal: controller.signal,
onComplete: clearStreamTimeout,
plugins: [
(value) => {
// Even though we sanitized errors on context.errors prior to responding,
Expand Down
4 changes: 1 addition & 3 deletions packages/react-router/vendor/turbo-stream-v2/turbo-stream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,9 @@ export function encode(
plugins?: EncodePlugin[];
postPlugins?: EncodePlugin[];
signal?: AbortSignal;
onComplete?: () => void;
},
) {
const { plugins, postPlugins, signal, onComplete } = options ?? {};
const { plugins, postPlugins, signal } = options ?? {};

const encoder: ThisEncode = {
deferred: {},
Expand Down Expand Up @@ -275,7 +274,6 @@ export function encode(
}
await Promise.all(Object.values(encoder.deferred));

onComplete?.();
controller.close();
},
});
Expand Down