Skip to content

fix: avoid body stream already read on fallback - #886

Merged
rinarjn merged 1 commit into
ffmpegwasm:mainfrom
rinarjn:fix/progress-clean
Aug 16, 2025
Merged

rinarjn merged 1 commit into
ffmpegwasm:mainfrom
rinarjn:fix/progress-clean

Conversation

@rinarjn

@rinarjn rinarjn commented Aug 16, 2025

Copy link
Copy Markdown
Collaborator

Fix “body stream already read” & Playground stall after switching to jsDelivr.

Why it appeared after switching CDNs:

  • unpkg often didn’t send Content-Length, so strict byte check never ran.
  • jsDelivr sends a compressed response with Content-Length. Our progress counts decoded bytes, which don’t match the compressed length, so the fallback tried to read the same Response twice.
  • In dev, React StrictMode double-invocation makes this more likely to surface. In prod, it stalls the Playground around 90–98%.
  • Fix: read the fallback from a cloned Response.

@netlify

netlify Bot commented Aug 16, 2025 •

Copy link
Copy Markdown

✅ Deploy Preview for ffmpegwasm canceled.

Name Link
🔨 Latest commit dee8f4c
🔍 Latest deploy log https://app.netlify.com/projects/ffmpegwasm/deploys/68a03bec31c11e0007bf89f9

@rinarjn
rinarjn marked this pull request as ready for review August 16, 2025 08:12
@rinarjn
rinarjn merged commit 158e59f into ffmpegwasm:main Aug 16, 2025
@rinarjn
rinarjn deleted the fix/progress-clean branch August 16, 2025 08:39
@lucasgelfond

Copy link
Copy Markdown
Collaborator

amazing ty for catching!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants