Repository navigation
Release/2.5.3: fix PDF uploads in common-file-uploader - #19
Merged
Merged
Conversation
pdfjs-dist 4.x has no main-thread fallback without a worker: getDocument() throws 'No "GlobalWorkerOptions.workerSrc" specified.' unless globalThis.pdfjsWorker is set, so every PDF upload failed with CannotOpenPDF in apps that never set PdfService.workerSrc. Import the legacy worker module and register it in that case. Keep both imports behind .catch() so pdfjs-dist stays an optional peer, and cache pdfjs only after the worker is registered so concurrent and retried calls work.
There was a problem hiding this comment.
🟡 Changes recommended
The release’s central pdfjs integration is tested only through virtual mocks that reproduce the production assumption.
1 open finding
What changed in this PR
Fixes PDF uploads when consumers do not configure PdfService.workerSrc.
Changes:
- Registers the bundled pdfjs worker as a main-thread fallback.
- Adds worker-loading, concurrency, retry, and error tests.
- Bumps the release to 2.5.3 with release notes.
| File | Description |
|---|---|
src/lib/components/file-uploader/pdf.service.ts |
Adds bundled worker fallback. |
src/lib/components/file-uploader/pdf.service.spec.ts |
Tests worker loading behavior. |
projects/common-lib/package.json |
Bumps library version. |
package.json |
Bumps root version. |
package-lock.json |
Synchronizes locked version metadata. |
CHANGELOG.md |
Documents the 2.5.3 fix. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
istevens507
enabled auto-merge (squash)
October 13, 2026 21:57
cyrilbravo
approved these changes
Oct 13, 2026
cyrilbravo
left a comment
Contributor
There was a problem hiding this comment.
Changes looks good to me.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Problem
Every PDF upload failed with
CannotOpenPDF("That PDF cannot be opened, please upload a different attachment." in MSP) in apps that never setPdfService.workerSrc. That includes MSP DEAM. pdfjs-dist 4.x has no main-thread fallback when no worker is configured, sogetDocument()threwNo "GlobalWorkerOptions.workerSrc" specified.. Affects 2.1.0 through 2.5.2. Image uploads were not affected.Fix
PdfService.load(): whenworkerSrcis unset, importpdfjs-dist/legacy/build/pdf.worker.mjsand register it asglobalThis.pdfjsWorker, so pdfjs runs the worker on the main thread..catch(), sopdfjs-diststays an optional peer.workerSrcare unchanged. No public API or peer-range change.Release
build_utils/release-set-version.sh), with a CHANGELOG entry.release-preflight.sh 2.5.3passes.release.ymland publishes 2.5.3.