Skip to content

Fix session saves for image-heavy boards#222

Merged
devmobasa merged 1 commit into
mainfrom
fix/220-session-restore-external-images
May 20, 2026
Merged

Fix session saves for image-heavy boards#222
devmobasa merged 1 commit into
mainfrom
fix/220-session-restore-external-images

Conversation

@devmobasa
Copy link
Copy Markdown
Owner

Fixes #220

Summary

Fixes session persistence for large boards that contain embedded images and annotations.

Session saves now check the final bytes that will actually be written, after the configured compression mode is applied. This prevents image-heavy sessions from being rejected just because their raw JSON representation exceeds session.max_file_size_mb when the compressed session file would fit.

Changes

  • Apply session.max_file_size_mb to final written payload bytes instead of raw JSON bytes
  • Keep existing fallback behavior:
    • full snapshot when it fits
    • trimmed undo/redo history when full history does not fit
    • visible-only snapshot when history cannot fit
    • error only when visible data still cannot fit
  • Preserve all board pages; no 9-page persistence cap is introduced
  • Add regression coverage for 12-page image-heavy sessions with annotations
  • Add a roundtrip guard for pages beyond the visible 1-9 shortcuts

@devmobasa devmobasa merged commit 61ab09a into main May 20, 2026
2 checks passed
@devmobasa devmobasa deleted the fix/220-session-restore-external-images branch May 21, 2026 05:57
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.

[BUG] Board/session restore loses annotations or content when using external images

1 participant