File: packages/better-fetch/src/fetch.ts (response cloning logic, PR #78)
Fix: Clone the response body before passing it to any hook or consumer. The pattern should be: const cloned = response.clone(); const body = await cloned.json() hand cloned to hooks and let the original stream flow to the caller. Never read from the same stream twice. Merge or incorporate the fix from PR #78 and add a test that enables cloneResponse then reads the body inside onError.
This issue was identified by an agentic audit tool. If this doesn't apply to your project, feel free to close it.
File: packages/better-fetch/src/fetch.ts (response cloning logic, PR #78)
Fix: Clone the response body before passing it to any hook or consumer. The pattern should be: const cloned = response.clone(); const body = await cloned.json() hand cloned to hooks and let the original stream flow to the caller. Never read from the same stream twice. Merge or incorporate the fix from PR #78 and add a test that enables cloneResponse then reads the body inside onError.
This issue was identified by an agentic audit tool. If this doesn't apply to your project, feel free to close it.