revert evictFromCache, add back delay + marks invalidation

Remove evictFromCache entirely - the cache-manipulation approach was
brittle and broke both archive (photos not removed) and tags
(colors/ratings showing empty). Replace with: 200ms delay before
invalidation to let PhotoPrism's indexer process the change, plus
invalidateQueries(['marks']) so tag caches (colors, ratings, notes)
refresh alongside the photo timeline.
This commit is contained in:
2026-06-07 22:31:39 +02:00
parent 82f2a40269
commit 73c36b4817
5 changed files with 14 additions and 45 deletions

View File

@@ -1,6 +1,6 @@
import { toast } from 'svelte-sonner';
import { batchEdit } from '$lib/services/batch';
import { invalidatePhotos, evictFromCache } from '$lib/services/bulk';
import { invalidatePhotos } from '$lib/services/bulk';
import {
addToHeap,
approvePhoto,
@@ -194,10 +194,10 @@ export function gridKeyNav(node: HTMLElement, params: GridKeyNavParams = {}) {
return;
}
doneBulk(doneLabel, ids);
evictFromCache(ids);
focusAfter(ids);
clearSelection();
invalidatePhotos(ids);
void queryClient.invalidateQueries({ queryKey: ['marks'] });
toast.success(doneLabel, { id: tid });
pushUndo(doneLabel, async () => {
if (target) await batchRestore(ids);
@@ -234,10 +234,10 @@ export function gridKeyNav(node: HTMLElement, params: GridKeyNavParams = {}) {
return;
}
doneBulk(`Deleted ${ids.length}`, ids);
evictFromCache(ids);
focusAfter(ids);
clearSelection();
invalidatePhotos(ids);
void queryClient.invalidateQueries({ queryKey: ['marks'] });
toast.success(`Deleted ${ids.length}`, { id: tid });
}
@@ -272,7 +272,6 @@ export function gridKeyNav(node: HTMLElement, params: GridKeyNavParams = {}) {
doneBulk(`Kept ${ids.length}`, ids);
toast.success(`Kept ${ids.length}`, { id: tid });
}
evictFromCache(ids);
focusAfter(ids);
clearSelection();
invalidatePhotos(ids);