bettersight-statement-extra.../frontend
JasonFraser 42ff3e364f Fix pdf.js getDocument() call shape and document-switch cleanup
Two real bugs from the first real test of R.1's pdf.js viewer:

1. getDocument(url) was called with a bare string. The installed
   pdfjs-dist (6.4.299) requires an object - getDocument(src = {})
   only ever reads src.url/src.data/src.range, so src.url ended up
   undefined and pdf.js threw its own "expected either data, range, or
   url parameter" error, exactly what was reported. Fixed:
   getDocument({ url }).

2. Found while fixing #1: cleanup called pdfDoc.value.destroy(), but
   destroy() lives on the loading task (getDocument()'s own synchronous
   return value), not the resolved PDFDocumentProxy, which has no
   destroy of its own - confirmed via the package's own type
   definitions and a real Node script throwing "doc.destroy is not a
   function" otherwise. Fixed by keeping the loading task and calling
   loadingTask.destroy() instead.

Verified for real via pdf.js's own Node support, not just re-reading
the code: the buggy call shape reproduced the exact reported error
first, the fix loaded both the HSBC and RBC fixtures correctly, and
loading a second document after destroying the first (the real
document-switching scenario) succeeded cleanly.

Traced but could not find a code path connecting this to the separately
reported empty transactions table - that computed has no dependency on
the source panel's state. Fixed the confirmed bug; did not claim that
symptom is resolved.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-10-13 11:40:07 -04:00
..
.vscode Restructure frontend to Vue 3 + Vite (Stage 2 of 2) 2026-10-12 06:32:49 -04:00
public Restructure frontend to Vue 3 + Vite (Stage 2 of 2) 2026-10-12 06:32:49 -04:00
src Fix pdf.js getDocument() call shape and document-switch cleanup 2026-10-13 11:40:07 -04:00
.gitignore Restructure frontend to Vue 3 + Vite (Stage 2 of 2) 2026-10-12 06:32:49 -04:00
README.md Restructure frontend to Vue 3 + Vite (Stage 2 of 2) 2026-10-12 06:32:49 -04:00
index.html Restructure frontend to Vue 3 + Vite (Stage 2 of 2) 2026-10-12 06:32:49 -04:00
package-lock.json Replace the native PDF iframe with a pdf.js viewer for row highlighting 2026-10-13 11:26:48 -04:00
package.json Replace the native PDF iframe with a pdf.js viewer for row highlighting 2026-10-13 11:26:48 -04:00
vite.config.js Restructure frontend to Vue 3 + Vite (Stage 2 of 2) 2026-10-12 06:32:49 -04:00

README.md

Vue 3 + Vite

This template should help get you started developing with Vue 3 in Vite. The template uses Vue 3 <script setup> SFCs, check out the script setup docs to learn more.

Learn more about IDE Support for Vue in the Vue Docs Scaling up Guide.