Skip to content

[PB-6591] feature/Photos database backup - #538

Merged
CandelR merged 2 commits into
feature/PB-6068-photos-backupfrom
feature/PB-6591-photos-database-backup
Jul 30, 2026
Merged

[PB-6591] feature/Photos database backup#538
CandelR merged 2 commits into
feature/PB-6068-photos-backupfrom
feature/PB-6591-photos-database-backup

Conversation

@CandelR

@CandelR CandelR commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Add a device sync manifest so a reinstall or re-login restores Photos backup state without re-checking every asset against the backend.

Summary

  • PhotoSyncManifestService: exports asset_sync to an encrypted manifest.json under {deviceFolder}/.sync/`. Restore validates schema version and device id, keeps only entries whose asset still exists in the local gallery, and inserts them back in a transaction.
  • thunks/upload.ts: manifest checkpoint during the cycle plus a final upload at the end of any cycle that uploaded something.
  • store/slices/photos: restoreLocalDbFromManifestThunk runs at the start of each backup cycle.
  • PhotoUploadQueue: added isCycleRunning() and waitForCycleEnd(timeoutMs), backed by a deferred resolved in endCycle().
  • Sign-out flow (auth + photos slices): Photos drains any in-flight upload cycle, uploads a last-chance manifest snapshot and wipes its local DB before credentials are cleared.
  • SignOutModal: shows a spinner and a "Saving your latest Photos data…" message while sign-out runs.

@CandelR
CandelR requested a review from larryrider July 17, 2026 11:20
@CandelR CandelR self-assigned this Jul 17, 2026
@CandelR CandelR added the enhancement New feature or request label Jul 17, 2026
Comment thread src/services/photos/PhotoSyncManifestService.ts Fixed
@sonarqubecloud

Copy link
Copy Markdown

@CandelR
CandelR merged commit d69e7a8 into feature/PB-6068-photos-backup Jul 30, 2026
3 checks passed
@CandelR
CandelR deleted the feature/PB-6591-photos-database-backup branch July 30, 2026 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants