Repository navigation
Conversation
downloadBlob only logged a failed download, so createDocument().download() resolved and onError never ran. downloadBlob rethrows the error after logging it.
resolveFont registered a pre-baked container even when its fonts did not define the family, and pdfmake failed later while building the file. Such a container falls back to Helvetica, like a font URL that fails to load.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the download-error propagation and font-fallback fixes.
No open issues 🎉
What changed in this PR
Brings two fixes from #318 to the v4.x PDF toolkit introduced in #317, improving download error reporting and pre-baked font fallback behavior.
Changes:
- Rethrows download errors so
createDocument().download()rejects and callsonError. - Falls back to Helvetica when a pre-baked font container lacks the requested family.
- Adds regression tests for both fixes.
| File | Description |
|---|---|
src/utils/pdf/resolve-font.js |
Checks the requested family before registering a font container. |
src/utils/pdf/download-blob.js |
Rethrows download errors after logging them. |
src/utils/pdf/__tests__/resolve-font.test.js |
Tests fallback when a container lacks the requested family. |
src/utils/pdf/__tests__/download-blob.test.js |
Tests that browser download errors propagate. |
src/utils/pdf/__tests__/create-document.test.js |
Tests download rejection and onError notification. |
Review effort: Balanced
ref: https://app.clickup.com/t/86bbf0d90
The same two fixes as #318 (0f47091 and 38a3a7a), for the toolkit #317 added to v4.x: