fix(mobile): server side check in manageLinkedAlbums + wire to organize

mobile cache only trusts SyncStream events.  if the server looses an album silently (audit table empty) manage never spots the stale id. now fetch getAllOwned first, prune the cached row, then recreate or relink by name.

also the organize button only ran sync passes before. now it runs manageLinkedAlbums too so toggle off and on actually reconciles the cache.

added unit tests for both paths. verifed on pixel 9a with a sql soft delete on a local v3 server, audit row stays empty just like users 'clean reinstall' case.
This commit is contained in:
Santo Shakil
2026-05-11 21:03:57 +06:00
parent 97430bec14
commit 8d918a65ef
4 changed files with 235 additions and 30 deletions
@@ -69,6 +69,7 @@ class _AlbumSyncActionButtonState extends ConsumerState<_AlbumSyncActionButton>
});
try {
await _manageLinkedAlbums();
await ref.read(backgroundSyncProvider).syncLinkedAlbum();
await ref.read(backgroundSyncProvider).syncRemote();
} catch (_) {