Bump submodule: cap .spd composite image size to avoid OOM crash - #149
Open
philips-clanker wants to merge 1 commit into
Open
Bump submodule: cap .spd composite image size to avoid OOM crash#149philips-clanker wants to merge 1 commit into
philips-clanker wants to merge 1 commit into
Conversation
Stacked on supernote-typescript#39, not yet merged - points at that branch rather than main. Rebase once it merges.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Picks up supernote-typescript#39, a fix found while investigating #147 (crash/"boot loop" opening certain notes).
toImage()sized its composited.spdoutput 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.spdfile 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) - cleannpx tsc --noEmit- cleannpx eslint src/main.ts src/atelierView.ts- 0 errorsnpx vitest run- 95 passed.spdfile)