Summary
src/lib/NotesEditor.svelte cancels the debounce when activeNote changes, then fires command("write_note", ...) for the previous note with .catch(() => {}).
- That write is not awaited, and the editor immediately advances to the next note.
- If
write_note rejects during that handoff, the old note's dirty buffer is dropped silently: there is no retry, no error surface, and no way to recover the unsaved text from UI state.
src/lib/NotesEditor.test.ts does not cover a rejected write_note during note switching.
This is a silent data-loss path in note editing. Remediation: keep the previous note dirty until the flush succeeds, or block/restore the switch on failure, and add a regression test for rejected flushes during note switching.
Maintainer Metadata
- Fingerprint:
autosave|data|loss|note|notes|noteseditor|silent|state|test|ts|write
- Symptom Type:
silent data loss
- Affected Files: src/lib/NotesEditor.svelte, src/lib/NotesEditor.test.ts
- Keywords: notes, autosave, write_note, state_loss
Summary
src/lib/NotesEditor.sveltecancels the debounce whenactiveNotechanges, then firescommand("write_note", ...)for the previous note with.catch(() => {}).write_noterejects during that handoff, the old note's dirty buffer is dropped silently: there is no retry, no error surface, and no way to recover the unsaved text from UI state.src/lib/NotesEditor.test.tsdoes not cover a rejectedwrite_noteduring note switching.This is a silent data-loss path in note editing. Remediation: keep the previous note dirty until the flush succeeds, or block/restore the switch on failure, and add a regression test for rejected flushes during note switching.
Maintainer Metadata
autosave|data|loss|note|notes|noteseditor|silent|state|test|ts|writesilent data loss