Skip to content

Bump submodule: cap .spd composite image size to avoid OOM crash - #149

Open
philips-clanker wants to merge 1 commit into
mainfrom
cap-atelier-composite-size-issue-147
Open

Bump submodule: cap .spd composite image size to avoid OOM crash#149
philips-clanker wants to merge 1 commit into
mainfrom
cap-atelier-composite-size-issue-147

Conversation

@philips-clanker

Copy link
Copy Markdown
Collaborator

Summary

Picks up supernote-typescript#39, a fix found while investigating #147 (crash/"boot loop" opening certain notes). toImage() sized its composited .spd output against the tile-grid bounding box across every tile in the file, with no sanity check - a single outlier tile (corrupted file, or a stray mark far off Atelier's own virtual canvas) could make it allocate gigabytes for what should be a small image. On a memory-constrained mobile WebView that's a hard, non-catchable crash rather than a slow tab - and since Obsidian mobile reopens the last file on relaunch, one bad .spd file would crash it again immediately, in a loop.

Note: the reporter on #147 has since clarified their crashing file is .note, not .spd, so this specific fix likely isn't the cause of that report - it's a real, independently-verified bug found along the way (no bounds check at all is worth fixing regardless), while the .note-specific investigation continues separately on that issue.

SupernoteAtelierView.updateImage() already wraps this call in try/catch and renders errors in-view, so no changes needed on this repo's side beyond the submodule bump - a bad file now surfaces as a normal "couldn't open this file" error instead of crashing.

Stacked on supernote-typescript#39, not yet merged - this PR's submodule pointer currently points at that branch. Rebase once it merges.

Test plan

  • npm run build (both submodule and plugin) - clean
  • npx tsc --noEmit - clean
  • npx eslint src/main.ts src/atelierView.ts - 0 errors
  • npx vitest run - 95 passed
  • Submodule's own test suite (41 passed, including 2 new regression tests using a synthetic corrupted .spd file)

Stacked on supernote-typescript#39, not yet merged - points at that
branch rather than main. Rebase once it merges.
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