From e5dcdac65adfd367e11304fa047b925ffbaaa9b6 Mon Sep 17 00:00:00 2001 From: Julien Calixte Date: Sun, 17 May 2026 00:07:20 +0200 Subject: [PATCH] feat(offline): record structured failures during note caching Expose a failures list alongside the existing failedNotes counter so each failure carries kind/path/sha/message. Also catches throws from buildNoteDocs and bulkUpdate that previously aborted the whole loop. --- src/modules/note/components/CacheAllNote.vue | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/modules/note/components/CacheAllNote.vue b/src/modules/note/components/CacheAllNote.vue index 9cb94ac..0508283 100644 --- a/src/modules/note/components/CacheAllNote.vue +++ b/src/modules/note/components/CacheAllNote.vue @@ -2,13 +2,20 @@ import { useOfflineNotes } from "@/hooks/useOfflineNotes.hook" import { confirmMessage, errorMessage } from "@/utils/notif" -const { cacheAllNotes, isLoading, totalOfNotes, noteCompleted, failedNotes } = - useOfflineNotes() +const { + cacheAllNotes, + isLoading, + totalOfNotes, + noteCompleted, + failedNotes, + failures +} = useOfflineNotes() const confirmBeforeCachingAllNotes = async () => { confirm("Do you want to cache all notes?") await cacheAllNotes() if (failedNotes.value > 0) { + console.table(failures.value) errorMessage( `${failedNotes.value} of ${totalOfNotes.value} note(s) could not be cached — try again` )