Skip to content

Conversation

@PeterOmbodi
Copy link
Contributor

Description

Under certain conditions, after the remote trash is emptied, assets may be uploaded again from the mobile device to the cloud.

see: #16732 (comment)

Reproduction conditions:

  • Enable backup is turned on.
  • The asset belongs to an album included in the backup list.
  • Automatic trash sync is enabled.

Steps to reproduce:

  1. Delete the asset in the cloud.
  2. Empty the cloud trash.
  3. Launch or bring the mobile app to the foreground.
  4. Verify that the asset is still present in the app timeline.
  5. Verify that the asset is uploaded to the cloud again.

Root cause:
The current trash sync logic effectively synchronizes the remote and local trash states.
If the remote trash is emptied immediately after deletion, the sync list remains empty, and the corresponding local asset is not moved to the local trash. When the backup queue runs, the asset is uploaded to the cloud again.

Fixes # (#26069)
Handling for permanently deleted remote assets has been added.
If a local asset associated with a permanently deleted remote asset is found, it is automatically moved to the local trash.

How Has This Been Tested?

Repeat steps 1–3 from Steps to reproduce.
4. Verify that the asset is no longer present in the app timeline.
5. Verify that the asset is not uploaded back to the cloud.

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/)

LLM usage:
GPT-5.3 Codex was used to help verify SQL queries and assist in writing tests.

...

Peter Ombodi added 2 commits February 9, 2026 15:38
- trash local assets on remote delete events
- unify remote trash handling and support assetDelete cleanup by remote asset id
- update sync stream tests
@immich-push-o-matic
Copy link

immich-push-o-matic bot commented Feb 9, 2026

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

@PeterOmbodi PeterOmbodi marked this pull request as draft February 9, 2026 16:54
@PeterOmbodi PeterOmbodi marked this pull request as ready for review February 9, 2026 16:56
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.

1 participant