fix(store): hold session texts whose set-aside fails, never overwrite them

This commit is contained in:
bchanot committed 2026-10-14 23:11:59 +02:00
1 parent 1312b366b1
commit e34b7f282e
19 files changed
+1093 -86

No files matched your search

+26 -4
View File
@@ -621,7 +621,23 @@ application itself builds.
3. An unreadable draft or archive is set aside under `osteo:quarantine:*`
with the `editor.draft_quarantined` alert, instead of being dropped
silently; a draft rebased with unresolved items keeps its raw text under
`osteo:quarantine:draft-pre-rebase`.
`osteo:quarantine:draft-pre-rebase`. An unreadable draft goes there with
the archive kept beside it, both or neither. A slot already holding
another text is never replaced. Owner rule of 2026-10-14 (maintenance B):
no session text is removed or overwritten implicitly when a save or a
set-aside fails. Such a text stays in place and is held: nothing is
opened over it (`RestoreResult` `held`: an unreadable draft, its
companion archive, an unreadable archive, or the original of a draft to
rebase), and the editor shows the resolution panel (download an exact
copy, delete permanently or open the adapted version after a
confirmation, retry). A new report or an import refuses to start
(`reason: 'held'`, alert, then the panel) while such a text is held, and
first reads through the core any draft this page never opened: an
unreadable one is set aside before the new session replaces it, a
readable one is replaced as before. The draft mirror is written only
when the report changes (an unrelated store change never removes it);
a refused write keeps the previous text and shows the `editor.save_failed`
banner until a write succeeds.
4. A core that cannot load leaves the editor on the degraded notice
(before R2 a failed sheet chunk left it on "loading").
5. Home and `/new` no longer load the sheet into memory on mount.
@@ -633,9 +649,9 @@ application itself builds.
8. The publish gate throws `SheetPublishError` with closed kinds
(`invalid_shape`, `not_publishable` with the same message as before,
`validator_unavailable`), never a raw ZodError.
9. An unreadable draft that cannot be set aside (storage full) keeps the
editor on the degraded notice, whose text speaks of the engine: wording to
revisit if the case matters.
9. Superseded by item 3 (maintenance B, 2026-10-14): an unreadable draft
that cannot be set aside shows the resolution panel, no longer the
engine notice.
### 8.8 Residual risks
@@ -653,6 +669,12 @@ application itself builds.
(practitioner, owner and animal data) until the tab closes, the same
exposure as `osteo:draft` itself (sessionStorage, tab and origin scoped);
nothing clears them on a new report, by design (they exist to survive it).
They have no interface yet: the practitioner cannot see or download a
set-aside text, and it disappears when the tab closes (owner decision
2026-10-14: follow-up, not part of the maintenance fix).
- "New report" from Home replaces the tab's readable draft without asking,
as before R2 (a single draft per tab, the PDF is the saved copy); the
maintenance fix only guards texts that are unreadable or held.
- Base images by tag, the new `rust:1.99.0-bookworm` included (digest pinning
is the Step 27 follow-up of R0).
- The documented CSP refuses the footer's external credit logo