fix(sync): surface attachment/folder restore failures (audit 2.3)

applyRemoteSnapshot swallowed attachment + folder restore errors in silent
catch blocks. Count them (attFailed/folderFailed) and warn in a toast after
the sync summary. These don't abort the push (the entry synced, only its
attachment/folder didn't) unlike a failed entry import.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
r-zakarya
2026-07-11 18:32:15 +01:00
parent b9eee0e15e
commit 92ed153bc0
2 changed files with 16 additions and 6 deletions
+1 -1
View File
@@ -268,7 +268,7 @@ test('merge: empty/invalid remote snapshot is a no-op', async () => {
const { T, db } = await freshMerge();
db.seedEntry({ uuid: 'u1' });
const res = await T.applyRemoteSnapshot(null);
assert.deepEqual({ ...res }, { added: 0, updated: 0, deleted: 0, failed: 0 });
assert.deepEqual({ ...res }, { added: 0, updated: 0, deleted: 0, failed: 0, attFailed: 0, folderFailed: 0 });
assert.equal(db.entries.length, 1);
});