blocker
b1
components/document-reader.tsx
Render operations can overlap on the same canvas
Rapid container resizes trigger re-renders while a prior render is still in flight on the same surface, and the renderer throws on concurrent use of one canvas
blocker
b2
components/document-reader.tsx
Every page retains a full resolution pixel buffer
A long document at high device pixel ratio holds hundreds of megabytes of canvas backing memory because no page ever releases its buffer
should-fix
s1
components/document-reader.tsx
Per-page failures bypass the error state
A corrupt page or a failed chunk load after the document opens leaves blank surfaces instead of the unavailable state
should-fix
s2
components/document-reader.tsx
Unmount races the module import
Unmounting before the renderer module resolves lets the async body continue and create a loading task that no cleanup owns
nit
n1
components/document-reader.tsx
Backing store and style sizes round independently
Fractional widths floor twice and drift the backing store off the styled size by a pixel, softening glyph edges
open after round: b1 b2 s1 s2 n1
repair
Rewrote the renderer around windowed rendering. Only pages near the viewport hold pixels and pages leaving the window release their buffers. Render tasks are tracked per page and cancelled before reuse. The whole async path reports into the error state and cancellation is checked after every await. Sizes round once from a shared css width.
sha256:6f1f3a2b9c8d47e5a0b1c2d3e4f5061728394a5b6c7d8e9f0a1b2c3d4e5f6a7b