• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

carlobeltrame / ecamp3 / 30161185352
34%
devel: 43%

Build:
Build:
LAST BUILD BRANCH: fix-react-pdf-upgrade
DEFAULT BRANCH: devel
Ran 25 Jul 2026 02:15PM UTC
Jobs 0
Files 0
Run time –
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
  cancel
30161185352

push

github

carlobeltrame
Fix client PDF hang in Firefox by decoding PNGs synchronously

With the react-pdf upgrade (@react-pdf/pdfkit 4.1.0 -> 5.1.1), client-side
PDF generation started hanging forever at 99% in Firefox: after all pages
render, toBlob() never resolves and the worker never returns the blob.

Root cause: pdfkit 5.x switched its PNG decoder from @react-pdf/png-js@3 to
upstream png-js@2. png-js@2's browser build decodes PNGs via fflate's async
unzlib(data, cb), which spawns a Web Worker (Blob URL) per call. Our PDF
render already runs inside a web worker, so every PNG decode spawns a NESTED
web worker. Firefox delivers nested-worker messages unreliably under CPU
load, so some decode callbacks never fire. The affected image XObjects (the
Twemoji emoji PNGs that react-pdf embeds for emoji in the camp text) then
never get .end() called, so document._waiting never reaches 0, push(null)
is never emitted, and the PDF stream never finishes.

This was observed as a flaky, deterministic-point hang: only in Firefox,
only when rendering in the worker, only with enough emoji-bearing content,
and only under high CPU load (busy CI runner or a loaded local machine).

Fix: patch png-js to decode synchronously with unzlibSync. We are already
off the main thread, so a synchronous inflate is appropriate and removes the
nested workers entirely. Verified: 0 nested workers spawned and 0 hangs
across many runs under 24-28 concurrent CPU hogs, with document compression
left enabled. This makes the other attempted band-aids (disabling
compression, reducing CI DB_CPU_LIMIT, test retries, warm-up render)
unnecessary.

Also re-enable the clientPrint e2e test in Firefox, which the fix makes pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015hKARMY81YEh8znEzRsfqw
Source Files on build 30161185352
Detailed source file information is not available for this build.
  • Back to Repo
  • Github Actions Build #30161185352
  • 23d3c66b on github
  • Prev Build on fix-react-pdf-upgrade (#30049843665)
  • Next Build on fix-react-pdf-upgrade (#30169281787)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc