Summary
Editing a sticky note and navigating away within ~400ms loses the last keystrokes.
Where
apps/web/src/components/stickies/StickyNoteCard.tsx. The editor's onUpdate debounces persistSticky(html) by 400ms into debounceRef. The unmount cleanup only does clearTimeout(debounceRef.current), it never flushes the pending save, and there's no beforeunload flush.
Repro
Type into a note and immediately navigate away (or delete another note, or leave the stickies page) before the 400ms elapses. The last edit never reaches the server.
This is the same class as the page-editor autosave bug fixed in #322, just a different component.
Suggested fix
On cleanup, if a save timer is pending, flush it synchronously (persistSticky(editor.getHTML())) before clearing.
Summary
Editing a sticky note and navigating away within ~400ms loses the last keystrokes.
Where
apps/web/src/components/stickies/StickyNoteCard.tsx. The editor'sonUpdatedebouncespersistSticky(html)by 400ms intodebounceRef. The unmount cleanup only doesclearTimeout(debounceRef.current), it never flushes the pending save, and there's nobeforeunloadflush.Repro
Type into a note and immediately navigate away (or delete another note, or leave the stickies page) before the 400ms elapses. The last edit never reaches the server.
This is the same class as the page-editor autosave bug fixed in #322, just a different component.
Suggested fix
On cleanup, if a save timer is pending, flush it synchronously (
persistSticky(editor.getHTML())) before clearing.