Commit 51352ee
fix(cloudflare,deno): Remove overly aggressive text/plain streaming classification
The `classifyResponseStreaming` function classified `text/plain` responses
without a `Content-Length` header as streaming. This heuristic was too
aggressive because `new Response('some text')` creates a `text/plain`
response without Content-Length, causing simple non-streaming responses
to take the streaming code path.
In the streaming path, the span end and transaction flush are delayed
until a stream monitor completes, which can cause timing issues when
the response is passed between Durable Objects and Workers in the
Cloudflare runtime, leading to flaky test timeouts.
Removing this rule ensures simple text/plain responses are processed
through the non-streaming (immediate span end + flush) code path.
Known streaming content types (SSE, NDJSON, JSON streaming) are still
correctly detected.
Fixes #20209
Co-Authored-By: Claude <noreply@anthropic.com>
Agent-Logs-Url: https://github.com/getsentry/sentry-javascript/sessions/b58267a8-c6d6-4fc0-b4fb-82b5843bbf70
Co-authored-by: Lms24 <8420481+Lms24@users.noreply.github.com>1 parent a14b306 commit 51352ee
2 files changed
Lines changed: 2 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
| |||
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
23 | | - | |
24 | 22 | | |
25 | 23 | | |
26 | 24 | | |
27 | 25 | | |
28 | 26 | | |
29 | | - | |
30 | 27 | | |
31 | 28 | | |
32 | 29 | | |
33 | | - | |
34 | | - | |
| 30 | + | |
35 | 31 | | |
36 | 32 | | |
37 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
| |||
22 | 21 | | |
23 | 22 | | |
24 | 23 | | |
25 | | - | |
26 | 24 | | |
27 | 25 | | |
28 | 26 | | |
29 | 27 | | |
30 | 28 | | |
31 | | - | |
32 | 29 | | |
33 | 30 | | |
34 | 31 | | |
35 | | - | |
36 | | - | |
| 32 | + | |
37 | 33 | | |
38 | 34 | | |
39 | 35 | | |
| |||
0 commit comments