Skip to content

Conversation

@PeterOmbodi
Copy link
Contributor

@PeterOmbodi PeterOmbodi commented Nov 27, 2025

Description

Problem

The current implementation of trash sync and restore does not distinguish between assets deleted in different ways — Move to trash, Delete, or Delete from device.
This may lead to incorrect restoration of an asset from the trash, which users perceive as the file being re-uploaded again.

Solution

A flag has been added to the local table to differentiate assets moved to the remote trash from those deleted locally, which do not require restoration.
Only assets that have the corresponding flag are restored.

Fixes #24124

How Has This Been Tested?

  1. Make sure the trash sync mode is enabled.
  2. Prepare five assets with local copies from an album included in the backup - let’s call them A, B, C, D, and E.
  3. Move asset A to trash using the web interface.
  4. Move asset B to trash using the mobile app (open preview → details → Move to trash).
  5. Move asset C to trash using the mobile app (open preview → details → Delete).
  6. Move asset D to trash using the mobile app (open preview → details → Delete from device).
  7. Move asset E to trash using system tools (Google Photos/the device gallery app, or a file manager).
  8. Sync the device and verify that assets A, B, C, D, E appear in the device’s system trash.
  9. Restore assets A, B, C, D from the trash using the web interface.
  10. Sync the device again.
  11. Verify that assets A and B have the sync marker, and assets C, D, and E remain marked as remote assets.
  12. Open the system trash and confirm that C, D, and E are still present there.

Checklist:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation if applicable
  • I have no unrelated changes in the PR.
  • I have confirmed that any new dependencies are strictly necessary.
  • I have written tests for new code (if applicable)
  • I have followed naming conventions/patterns in the surrounding code
  • All code in src/services/ uses repositories implementations for database calls, filesystem operations, etc.
  • All code in src/repositories/ is pretty basic/simple and does not have any immich specific logic (that belongs in src/services/)
    ...

@immich-push-o-matic
Copy link

immich-push-o-matic bot commented Nov 27, 2025

Label error. Requires exactly 1 of: changelog:.*. Found: 📱mobile. A maintainer will add the required label.

Peter Ombodi added 6 commits November 27, 2025 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sync Remote Deletions features makes images download onto device

1 participant