From 93838060b203f28dc7c8533b3554750c5351f62c Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Sat, 10 Oct 2026 17:58:05 +0200 Subject: [PATCH] fix: image pasted into a note right after another save is lost on reload (#32175) Pasting an image into a note a moment after another change to that note was saved could lose the image. The note page got the result of the earlier save back after the paste and took over its older, empty list of attached files, so the image was saved without its file. After a reload it showed as a grey placeholder and was missing from the PDF export. The note page now keeps its own attached files while it still has a change waiting to be saved. Fixes #32123 --- src/lib/components/notes/NoteEditor.svelte | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/components/notes/NoteEditor.svelte b/src/lib/components/notes/NoteEditor.svelte index e87593cfd1..c04e7ee9b8 100644 --- a/src/lib/components/notes/NoteEditor.svelte +++ b/src/lib/components/notes/NoteEditor.svelte @@ -885,7 +885,8 @@ ${content} note.access_grants = _note.access_grants; } - if (_note.data && 'files' in _note.data) { + // A pending local save holds newer files than an echo of an earlier save. + if (_note.data && 'files' in _note.data && !debounceTimeout) { files = _note.data.files ?? []; note.data.files = files.length > 0 ? files : null; }