Repository navigation
fix: restore unsent drafts after browser navigation - #68
Conversation
|
Fork CI passed all gates for f2ee487 on both Windows and Linux: https://github.com/andrebrait/ompweb/actions/runs/34477574109 . Upstream Actions requires maintainer approval. Copilot and CodeRabbit review requested on the CI mirror: https://github.com/andrebrait/ompweb/pull/7 . No deployment or installed-package changes. |
|
Final head ef1d51c is green on Windows and Linux: https://github.com/andrebrait/ompweb/actions/runs/34480437640 . Copilot recommends approval with zero new comments: https://github.com/andrebrait/ompweb/pull/7#pullrequestreview-5167497792 . CodeRabbit completed review of the same head with no actionable comments and minimal merge risk: https://github.com/andrebrait/ompweb/pull/7#issuecomment-5618760888 . Its generic docstring-coverage warning is informational; no boilerplate comments or lowered thresholds were added. Both storage-cleanup findings have regression-tested fixes. Upstream Actions still requires maintainer approval; nothing was deployed or installed. |
Summary
Unsent composer text was kept only in an in-memory map, so a full browser Back/Forward navigation or reload discarded it. Persist text in tab-scoped sessionStorage and hydrate the existing draft map in each fresh document.
Verification
Scope and limitations
Recovery is best effort within the same browser tab while storage remains available. Images/files are not persisted. Existing FIFO retention is bounded to 50 drafts. No deployment or installed-package changes.
Review follow-up
Fixed Copilot's stored-overflow finding in 68bb4b3: snapshot storage keys, remove overflow beyond 50 on restore, and preserve unrelated settings. The new fresh-document regression failed before the correction and passes afterward. Final production browser smoke also confirmed 55 stored drafts are pruned to 50, unrelated storage survives, and Back/Forward plus clear/reload still work. Final Windows/Linux CI: https://github.com/andrebrait/ompweb/actions/runs/34480437640 . Empty stored values are also removed in ef1d51c; the same malformed-storage regression verifies this and preservation of unrelated settings.