[GH-ISSUE #7241] [Issue]: Safari can show "Marinara hit a recoverable UI error" when it can't read the page colour #4039

Closed
opened 2026-10-21 06:09:46 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @SpicyMarinara on GitHub (Oct 7, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/7241

Originally assigned to: @SpicyMarinara on GitHub.

Summary

On load and on every theme change, the app works out the colour for the iPhone safe area, the overscroll backing and the browser bar. To do that it paints onto a 1×1 canvas and reads the pixel back with getImageData (syncLiteralBackground in packages/client/src/App.tsx, added 2026-10-03). WebKit can refuse that read under memory pressure ("Unable to get image data from canvas" → InvalidStateError). The error is thrown inside a React effect, so the whole shell falls into "Marinara hit a recoverable UI error." instead of just keeping the plain background colour.

Expected behavior

If the browser won't read the canvas, the app keeps working and uses the theme's background colour as it is.

Actual behavior

The app shell crashes into the recovery screen.

Steps to reproduce

  1. Run the browser tests on mobile-webkit with 4 parallel workers (e2e/advanced-memory.e2e.ts, e2e/advanced-memory-wizard.e2e.ts).
  2. Some tests fail on the first page load. WebKit logs "Unable to get image data from canvas", and the page shows the recovery screen.
  3. The same tests pass when rerun with 1 worker.

Environment

  • Marinara Engine version: staging after 4234d024f
  • Install type: source
  • OS + version: macOS (Playwright WebKit); likely iOS Safari under memory pressure too
  • Browser or app shell: WebKit

Logs, screenshots, or video

InvalidStateError from context.getImageData(0, 0, 1, 1) in App.tsx. The verifier for #7236 found it while it was chasing the "blank app page" flakes in that PR's notes.

Additional context

The fix is to fall back to the unflattened theme colour when the read fails, and never to let it crash the shell.

Template check

  • I DID NOT read this template and provide the requested details.
Originally created by @SpicyMarinara on GitHub (Oct 7, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/7241 Originally assigned to: @SpicyMarinara on GitHub. ## Summary On load and on every theme change, the app works out the colour for the iPhone safe area, the overscroll backing and the browser bar. To do that it paints onto a 1×1 canvas and reads the pixel back with `getImageData` (`syncLiteralBackground` in `packages/client/src/App.tsx`, added 2026-10-03). WebKit can refuse that read under memory pressure ("Unable to get image data from canvas" → `InvalidStateError`). The error is thrown inside a React effect, so the whole shell falls into "Marinara hit a recoverable UI error." instead of just keeping the plain background colour. ## Expected behavior If the browser won't read the canvas, the app keeps working and uses the theme's background colour as it is. ## Actual behavior The app shell crashes into the recovery screen. ## Steps to reproduce 1. Run the browser tests on mobile-webkit with 4 parallel workers (`e2e/advanced-memory.e2e.ts`, `e2e/advanced-memory-wizard.e2e.ts`). 2. Some tests fail on the first page load. WebKit logs "Unable to get image data from canvas", and the page shows the recovery screen. 3. The same tests pass when rerun with 1 worker. ## Environment - Marinara Engine version: staging after 4234d024f - Install type: source - OS + version: macOS (Playwright WebKit); likely iOS Safari under memory pressure too - Browser or app shell: WebKit ## Logs, screenshots, or video `InvalidStateError` from `context.getImageData(0, 0, 1, 1)` in `App.tsx`. The verifier for #7236 found it while it was chasing the "blank app page" flakes in that PR's notes. ## Additional context The fix is to fall back to the unflattened theme colour when the read fails, and never to let it crash the shell. ## Template check - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-21 06:09:46 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@SpicyMarinara commented on GitHub (Oct 7, 2026):

Fixed on staging by #7242. Ships to main with the next promotion.

<!-- gh-comment-id:6037186691 --> @SpicyMarinara commented on GitHub (Oct 7, 2026): Fixed on `staging` by #7242. Ships to `main` with the next promotion.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#4039
No description provided.