Commit 45b2a56
committed
fix(core): consume response body in _flush() and _capture() to prevent Cloudflare Workers warnings
`_flush()` and the single-event `_capture()` path both call
`fetchWithRetry()` but discard the returned response without reading
the body. In runtimes like Cloudflare Workers that enforce response
body consumption, this causes cross-request promise resolution warnings
and may silently cancel post-flush error handling continuations.
Consume the response body with `res.text().catch(() => {})` at both
call sites so the underlying connection is properly cleaned up.
The `fetchWithRetry()` return type is preserved so callers that need
the response (e.g. surveys API) can still read it.
Fixes #31731 parent dc59f94 commit 45b2a56
1 file changed
+10
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
964 | 964 | | |
965 | 965 | | |
966 | 966 | | |
967 | | - | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
968 | 972 | | |
969 | 973 | | |
970 | 974 | | |
| |||
1139 | 1143 | | |
1140 | 1144 | | |
1141 | 1145 | | |
1142 | | - | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
1143 | 1151 | | |
1144 | 1152 | | |
1145 | 1153 | | |
| |||
0 commit comments