Skip to content

fix: recover rejected page rasters without resetting the reading session - #45

Merged
nkanf-dev merged 1 commit into
mainfrom
dev/page-render-retry
Oct 4, 2026
Merged

nkanf-dev merged 1 commit into
mainfrom
dev/page-render-retry

Conversation

@nkanf-dev

@nkanf-dev nkanf-dev commented Oct 3, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Report a rejected page raster with a reachable page-local alert and explicit Retry in main/reference readers. Retry replaces only React-PDF Page, keeps Document/worker ownership and reading state, and never silently retries.
  • Keep the card above real PDF text/link layers, outside the scaled/panned paper, usable at 10%–400% and short narrow viewports. Native keyboard activation returns focus to the owning reader; passive background errors/completion do not steal focus.
  • Retire obsolete callbacks after page/scale/size/session changes and unmount. Retry interrupts an older pinch preview without changing the intended scale or durable state.

Evidence

  • Unchanged main da504d9 negative control: run 37161596946, both grab/pointer cases reach a real injected native drawImage failure and hidden canvas, then fail because no alert exists. The baseline screenshot shows blank paper beside a healthy held thumbnail.
  • Initial UI negative control: 10/10 recovery cases failed before the source change. Further focused regressions exposed and fixed pending pinch continuation, focused-Retry removal, and late callbacks after normal/StrictMode unmount.
  • Local: 167 unit + 264 UI tests, TypeScript, ESLint, production build and deploy dry-run passed.
  • Initial targeted browser run: 37161856099, 74 passed / 6 expected compact-grid skips / 10 test failures. Trace review proved four checks sampled scroll before native Tab moved the PDF link into view; six used the wrong compact Back-button label. Strict checkpoints now follow user focus traversal; source and tolerances were unchanged.
  • Corrected raster cases: all 33 pass across Chromium, Firefox, WebKit, tablet/mobile Chromium and mobile WebKit in 37162536894. Screenshot-first raster checks, native annotation hit targets, Page replacement with retained Document/worker count, unchanged PDF-byte hashes and saved reading state, background reference ownership and navigation-away are covered.
  • That broader run exposed one existing WebKit timeline test reading an intermediate preview. Trace shows value3 sampled before final preview6, then correct release to6. Its test helper now observes the intended exact-coordinate preview before release. 37162860261 passes 10 repeats without retries.
  • Independent source, trace and representative desktop/mobile/error/recovered/10%/400%/short/reference screenshot review found no remaining implementation blocker.
  • Exact release head c25fb790688a2ea2d5b509b9869538dcfda553a7: push run37163067502 is clean with no retries: 238 Chromium/compact + 123 Firefox + 167 WebKit/mobile-WebKit acceptance, plus 10 Firefox and20 WebKit stability repeats. Checks and baseline evidence also passed; Cloudflare branch build succeeded.
  • PR run37163075015 completed successfully, but Chromium had one recovered retry in the unchanged dock/swap/float/close workflow (237 passed +1 flaky). Trace pinpoints Worker was terminated during Float while the docked Document is still loading, before Close; worker offsets exactly match the independently reproduced PDF.js pending-load retirement defect. Document file/options/lifecycle, workspace layout branches, services and dependencies are unchanged, and no Page/Retry existed at that point. The same-head push suite is retry-free. No error suppression or artificial settling wait was added.
  • Release-head desktop/mobile error and restored-raster screenshots inspected. Main CI and production build/asset verification remain pending.

Scope and files

Production code is limited to src/components/reader/ReaderViewport.tsx. New recovery UI/E2E tests and a 2,140-byte self-generated raster/link fixture document the behavior. Five adjacent E2E files use a stable reader-shell toolbar relation; the timeline test helper waits for observable native input completion. Playwright compact-project inclusion and README/fixture/coverage documentation are updated.

No public API, saved schema, dependency or workflow changes. No PDF bytes or stored workspace reset, Document remount retry, blanket blank-page heuristic, automatic retry loop or error suppression.

Limits

Failures are controlled at the native canvas drawing boundary in isolated synthetic-book contexts, not induced hardware memory exhaustion. Mobile projects are emulation, not physical iOS/VoiceOver certification. This does not fix the separately reproduced pending PDF.js worker teardown rejection, silent malformed-decoder output, or failed Document parsing. A very short reader scrolls the error card internally so Retry remains reachable.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
leafspace c25fb79 Commit Preview URL

Branch Preview URL
Oct 03 2026, 11:51 PM

@nkanf-dev
nkanf-dev marked this pull request as ready for review October 4, 2026 00:08
Copilot AI balanced review requested due to automatic review settings October 4, 2026 00:08

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@nkanf-dev
nkanf-dev merged commit 453dcbc into main Oct 4, 2026
11 checks passed
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.

2 participants