Skip to content

test(pdf-engine): pin the F-245 PDF-teardown fix#121

Merged
th3-br41n merged 1 commit into
mainfrom
fix/f245-pdf-teardown
Jul 8, 2026
Merged

test(pdf-engine): pin the F-245 PDF-teardown fix#121
th3-br41n merged 1 commit into
mainfrom
fix/f245-pdf-teardown

Conversation

@th3-br41n

Copy link
Copy Markdown
Contributor

0.2.2 anchor. F-245 — opening a PDF in Books/Preview crashed with "doc.destroy is not a function" because pdf.js v6 removed PDFDocumentProxy.destroy() (teardown moved to the loading task), and callers await doc.destroy(). The fix (openPdfDocument overrides doc.destroytask.destroy) shipped but was never verified — the seeded vault has no PDFs, so nothing exercised the close path (that's how it shipped unnoticed).

This locks it: a regression test simulating the exact v6 shape (a resolved proxy with no destroy + a task whose destroy returns a Promise) asserts openPdfDocument still exposes a Promise-returning destroy that delegates to the task. Without the override, doc.destroy is undefined and the test fails — reproducing the crash. pdfjs-dist is confirmed ^6.0.227.

Also verified the fix is correctly consumed: Books calls doc.destroy().catch() through the SDK engine.

Follow-up (separate, heavier): seed a real PDF book so the dogfood/e2e path opens + tears one down end-to-end — no book/asset seeding exists yet.

🤖 Generated with Claude Code

F-245 — opening a PDF in Books/Preview crashed with "doc.destroy is not a
function" because pdf.js v6 removed PDFDocumentProxy.destroy() (teardown
moved to the loading task), and callers await doc.destroy(). The fix
(openPdfDocument overrides doc.destroy → task.destroy) shipped but was
never verified — the seeded vault has no PDFs, so nothing exercised the
close path.

This locks it: a test simulating the exact v6 shape (a resolved proxy with
NO destroy + a task whose destroy returns a Promise) asserts
openPdfDocument still exposes a Promise-returning destroy that delegates to
the task. Without the override, doc.destroy would be undefined and the test
fails — reproducing the crash.

Follow-up (heavier, separate): seed a real PDF book so the dogfood/e2e path
opens + tears one down end-to-end (no book/asset seeding exists yet).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@th3-br41n th3-br41n merged commit dc6a835 into main Jul 8, 2026
3 checks passed
@th3-br41n th3-br41n deleted the fix/f245-pdf-teardown branch July 8, 2026 19:10
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.

1 participant