From f4377a1655d197cd3d5cc2122e572f5b46bbbc92 Mon Sep 17 00:00:00 2001 From: dwelle <5153846+dwelle@users.noreply.github.com> Date: Sat, 18 Jul 2026 22:34:29 +0200 Subject: [PATCH] tta rewrite: add server-side TODO for the SSE ERR_ABORTED annotation Co-Authored-By: Claude Fable 5 --- tta_rewrite_final.md | 1 + 1 file changed, 1 insertion(+) diff --git a/tta_rewrite_final.md b/tta_rewrite_final.md index b256f8212e..93b86eb770 100644 --- a/tta_rewrite_final.md +++ b/tta_rewrite_final.md @@ -284,6 +284,7 @@ All independently shippable; the client plan above assumes none of them. 3. **Terminal-frame hardening** (complements §2.2): emit error frames through `StreamingResponse.end()` so `[DONE]` always follows (route-catch path omits it today); move `loadGenerationContext` inside `streamTta`'s try; map `finishReason length/content_filter` → error/warning before `done`; add a comment-line heartbeat to `StreamingResponse` (client parser already tolerates it). 4. **S2** abort-refund loophole, **S3** non-additive partial throttling, **S4** advisory-lock order assignment — per their proposals. 5. **Shared wire types** (single source for `tta-types.ts` ⇄ client `types.ts`) once the client shape settles (step 3). +6. **TODO — `net::ERR_ABORTED` on successful SSE fetches**: Chromium tags every cross-origin TTA stream request with `net::ERR_ABORTED` even when the body is fully drained to EOF (verified 2026-07-18 by A/B: abandoned-after-`done` vs read-to-EOF both log it; client-side fixes are exhausted — the bounded drain in `client.ts` stays for keep-alive reuse only). If this ever pollutes prod error tracking/monitoring, investigate server-side: how `StreamingResponse` closes the socket after `end()` (connection-close vs keep-alive semantics, missing `Content-Length`, chunked-terminator handling) in `libs/server/fastifyutils/src/lib/streaming.ts`. Client-minted ids (old plan's Principle 1) are **dropped from scope entirely**: verified to require race-safe upserts + state-aware idempotency dedup server-side, while the client-side wins it promised are achieved by §2.4 (local canvas key) and §2.5 (buffer-until-`started`) without any server change.