[BUG] Unable to delete photos on Server when automatic backup is turned on #326

Closed
opened 2026-02-04 19:40:12 +03:00 by OVERLORD · 17 comments
Owner

Originally created by @ghost on GitHub (Sep 23, 2022).

Describe the bug
This is related to #165
Photo will not be deleted when Android app's automatic backup feature is turned on.

Task List

Please complete the task list below. We need this information to help us reproduce the bug or point out problems in your setup. You are not providing enough info may delay our effort to help you.

  • I have read thoroughly the README setup and installation instructions.
  • I have included my docker-compose file.
  • I have included my redacted .env file.
  • I have included information on my machine, and environment.

To Reproduce
Steps to reproduce the behavior:
I turned on the automatic backup feature on my android device and upload my Camera folder.
In the Immich Android app, I select and delete the photo.
The app contacts the server and deletes the selected photo briefly.
After just a moment, the automatic backup feature is triggered and the exact same photo gets uploaded to server from my Camera folder.
At the end, nothing gets deleted effectively.

Expected behavior
There are multiple feature requests in #165.
Immich app can provide choices to one of the following feature:

  • Act as a local gallery app, synced to cloud all the time. When photo gets deleted in the software, cloud + local copy get deleted all at once together. Keep server/client (local folder) download + upload two way synced.
  • Act as a backup app, only upload, one way synced. However, when one uploaded photo gets deleted in the app (meaning the server side), the automatic backup feature will not trigger automatic upload of the once deleted photo. Instead, a wait list of "uploaded but deleted" queue will be shown in the mobile app to have the user choose whether to upload some of the deleted photos.
  • Act as a one time upload app, not synced. Uploaded photo will not trigger any further upload unless user manually pick specific photos to be uploaded. Delete on the server and local storage happens separately and will not interfere. (This is Nextcloud auto-upload behavior)

Screenshots
If applicable, add screenshots to help explain your problem.

System

  • Phone OS Android: 12
  • Server Version: 1.29.4
  • Mobile App Version: 1.29.1 build.43

Additional context
Add any other context about the problem here.

Originally created by @ghost on GitHub (Sep 23, 2022). <!-- Note: Please search to see if an issue already exists for the bug you encountered. --> **Describe the bug** This is related to #165 Photo will not be deleted when Android app's automatic backup feature is turned on. **Task List** *Please complete the task list below. We need this information to help us reproduce the bug or point out problems in your setup. You are not providing enough info may delay our effort to help you.* - [x] I have read thoroughly the README setup and installation instructions. - [x] I have included my `docker-compose` file. - [x] I have included my redacted `.env` file. - [x] I have included information on my machine, and environment. **To Reproduce** Steps to reproduce the behavior: I turned on the automatic backup feature on my android device and upload my Camera folder. In the Immich Android app, I select and delete the photo. The app contacts the server and deletes the selected photo briefly. After just a moment, the automatic backup feature is triggered and the exact same photo gets uploaded to server from my Camera folder. At the end, nothing gets deleted effectively. **Expected behavior** There are multiple feature requests in #165. Immich app can provide choices to one of the following feature: - Act as a local gallery app, synced to cloud all the time. When photo gets deleted in the software, cloud + local copy get deleted all at once together. Keep server/client (local folder) download + upload two way synced. - Act as a backup app, only upload, one way synced. However, when one uploaded photo gets deleted in the app (meaning the server side), the automatic backup feature will not trigger automatic upload of the once deleted photo. Instead, a wait list of "uploaded but deleted" queue will be shown in the mobile app to have the user choose whether to upload some of the deleted photos. - Act as a one time upload app, not synced. Uploaded photo will not trigger any further upload unless user manually pick specific photos to be uploaded. Delete on the server and local storage happens separately and will not interfere. (This is Nextcloud auto-upload behavior) **Screenshots** If applicable, add screenshots to help explain your problem. **System** - Phone OS Android: 12 - Server Version: 1.29.4 - Mobile App Version: 1.29.1 build.43 **Additional context** Add any other context about the problem here.
Author
Owner

@alextran1502 commented on GitHub (Sep 23, 2022):

First, when you delete the asset from Immich, do you also choose to delete the asset on your device as well? From the behavior you described, I assumed you chose to only delete the asset on the Immich server.

If the asset is still present on your device, it will be rescanned to be uploaded in the next trigger. If you don't want this to happen, you must delete the photo you don't want to be backup first.

I think this is a expected behavior, because we the app is the backup tool, so if there is any files in the folder/album that isn't backup, it must perform the action of getting the file to the backup server.

@alextran1502 commented on GitHub (Sep 23, 2022): First, when you delete the asset from Immich, do you also choose to delete the asset on your device as well? From the behavior you described, I assumed you chose to only delete the asset on the Immich server. If the asset is still present on your device, it will be rescanned to be uploaded in the next trigger. If you don't want this to happen, you must delete the photo you don't want to be backup first. I think this is a expected behavior, because we the app is the backup tool, so if there is any files in the folder/album that isn't backup, it must perform the action of getting the file to the backup server.
Author
Owner

@ghost commented on GitHub (Sep 23, 2022):

When I choose delete, what is shown in the app is:

Delete permanantly
These items will be permanently deleted from immich and your device

But I did not see the photo gets deleted in my device. And the photo gets uploaded to the server briefly after the deletion.
Maybe this delete dialog is describing behavior inaccurately?

@ghost commented on GitHub (Sep 23, 2022): When I choose delete, what is shown in the app is: ``` Delete permanantly These items will be permanently deleted from immich and your device ``` But I did not see the photo gets deleted in my device. And the photo gets uploaded to the server briefly after the deletion. Maybe this delete dialog is describing behavior inaccurately?
Author
Owner

@alextran1502 commented on GitHub (Sep 23, 2022):

There are two stages of the deletion process

  1. Delete from Immich's server
  2. After deleting from Immich's server, the app will prompt you the native prompt to delete from the device. Since this process requires user's permission, the app cannot do this automatically.

This is similar to how Google Photos perform the deletion process. Can you help me confirm that you see the native prompt after deleting the asset from the database?

@alextran1502 commented on GitHub (Sep 23, 2022): There are two stages of the deletion process 1. Delete from Immich's server 2. After deleting from Immich's server, the app will prompt you the native prompt to delete from the device. Since this process requires user's permission, the app cannot do this automatically. This is similar to how Google Photos perform the deletion process. Can you help me confirm that you see the native prompt after deleting the asset from the database?
Author
Owner

@ghost commented on GitHub (Sep 23, 2022):

I did not see native prompt asking about local deletion. I think that is why I am confused.

@ghost commented on GitHub (Sep 23, 2022): I did not see native prompt asking about local deletion. I think that is why I am confused.
Author
Owner

@alextran1502 commented on GitHub (Sep 23, 2022):

Hmm, thank you I will take a look

@alextran1502 commented on GitHub (Sep 23, 2022): Hmm, thank you I will take a look
Author
Owner

@alextran1502 commented on GitHub (Sep 23, 2022):

I cannot reproduce this, can you help me uninstall the app and reinstall it. Then perform the deletion process again?

If possible can you perform the screen capture of the deletion process?

@alextran1502 commented on GitHub (Sep 23, 2022): I cannot reproduce this, can you help me uninstall the app and reinstall it. Then perform the deletion process again? If possible can you perform the screen capture of the deletion process?
Author
Owner

@ghost commented on GitHub (Sep 23, 2022):

gif-20220922-213229

@ghost commented on GitHub (Sep 23, 2022): ![gif-20220922-213229](https://user-images.githubusercontent.com/77554817/191877785-7d97ffe2-a9fc-4be0-9201-d5f8fc4ef3b0.gif)
Author
Owner

@alextran1502 commented on GitHub (Sep 23, 2022):

gif-20220922-213229 gif-20220922-213229

The second prompt with the thumbnail asking for deletion is the native prompt

@alextran1502 commented on GitHub (Sep 23, 2022): > ![gif-20220922-213229](https://user-images.githubusercontent.com/77554817/191877785-7d97ffe2-a9fc-4be0-9201-d5f8fc4ef3b0.gif) [ ![gif-20220922-213229](https://user-images.githubusercontent.com/77554817/191877785-7d97ffe2-a9fc-4be0-9201-d5f8fc4ef3b0.gif) ](https://user-images.githubusercontent.com/77554817/191877785-7d97ffe2-a9fc-4be0-9201-d5f8fc4ef3b0.gif) [ ](https://user-images.githubusercontent.com/77554817/191877785-7d97ffe2-a9fc-4be0-9201-d5f8fc4ef3b0.gif) The second prompt with the thumbnail asking for deletion is the native prompt
Author
Owner

@ghost commented on GitHub (Sep 23, 2022):

It asks for recycle bin and I selected allow. But my photo is still in the original position.

@ghost commented on GitHub (Sep 23, 2022): It asks for recycle bin and I selected allow. But my photo is still in the original position.
Author
Owner

@alextran1502 commented on GitHub (Sep 23, 2022):

It asks for recycle bin and I selected allow. But my photo is still in the original position.

Thank you, I will investigate this issue

@alextran1502 commented on GitHub (Sep 23, 2022): > It asks for recycle bin and I selected allow. But my photo is still in the original position. Thank you, I will investigate this issue
Author
Owner

@Nonobis commented on GitHub (Sep 28, 2022):

hello, i have the same problem

@Nonobis commented on GitHub (Sep 28, 2022): hello, i have the same problem
Author
Owner

@JVT038 commented on GitHub (Feb 15, 2023):

Can Immich not store a local list of items that the user has deleted from their Immich server, but not from their device?
Then, Immich can show this list of items and not upload it, unless the user tells Immich to upload them again.
Kind of like a 'blacklist', with items that should not be uploaded, despite it not being on the server.

@JVT038 commented on GitHub (Feb 15, 2023): Can Immich not store a local list of items that the user has deleted from their Immich server, but not from their device? Then, Immich can show this list of items and not upload it, unless the user tells Immich to upload them again. Kind of like a 'blacklist', with items that should not be uploaded, despite it not being on the server.
Author
Owner

@jrasm91 commented on GitHub (Feb 15, 2023):

Yeah, that's exactly what we've talked about doing actually. Deleting an asset moves it to a blacklist, the mobile app can check if a file needs to be backed-up by calling an updated server endpoint which takes the blacklist into account and returns the right answer for each asset. Then the user can update/manage the blacklist and/or the user can "force upload" a file, which basically removes it from the blacklist as part of the process.

@jrasm91 commented on GitHub (Feb 15, 2023): Yeah, that's exactly what we've talked about doing actually. Deleting an asset moves it to a blacklist, the mobile app can check if a file needs to be backed-up by calling an updated server endpoint which takes the blacklist into account and returns the right answer for each asset. Then the user can update/manage the blacklist and/or the user can "force upload" a file, which basically removes it from the blacklist as part of the process.
Author
Owner

@simone-viozzi commented on GitHub (May 12, 2023):

I encountered a similar issue by deleting photos from the web UI / another device.
Since those photo were still in the memory of the original device that uploaded them, the automatic sync re-uploaded them.

This forced me to delete the photos from immich from the device that uploaded them.

The expected behavior I would like is for immich to blacklist those images and do not re-upload them. Since the user explicitly deleted them from immich.

Or even better, if a photo is deleted from another device, you get a notification on the device that uploaded it that prompt you to delete the photo from the internal memory of the device.
On the line of: "this group of photos were deleted from immich, do you also want to delete them from your device?"

@simone-viozzi commented on GitHub (May 12, 2023): I encountered a similar issue by deleting photos from the web UI / another device. Since those photo were still in the memory of the original device that uploaded them, the automatic sync re-uploaded them. This forced me to delete the photos from immich from the device that uploaded them. The expected behavior I would like is for immich to blacklist those images and do not re-upload them. Since the user explicitly deleted them from immich. Or even better, if a photo is deleted from another device, you get a notification on the device that uploaded it that prompt you to delete the photo from the internal memory of the device. On the line of: "this group of photos were deleted from immich, do you also want to delete them from your device?"
Author
Owner

@lukanowa commented on GitHub (Aug 7, 2023):

I think I know where is the problem. Problem is that Immich don't update status of photos in app after uploaded to server. When I open app and there is photos to upload on server I see that this photos was uploaded ok but status (cloud icon) never change. Until I close app and open again I can't archive this photo and when I deleted this photo it is appear again after reopen app. But after successful uploaded photo and close app, then open again (status of previous uploaded photos changed to ok) then everything works ok (archive and delete).

@lukanowa commented on GitHub (Aug 7, 2023): I think I know where is the problem. Problem is that Immich don't update status of photos in app after uploaded to server. When I open app and there is photos to upload on server I see that this photos was uploaded ok but status (cloud icon) never change. Until I close app and open again I can't archive this photo and when I deleted this photo it is appear again after reopen app. But after successful uploaded photo and close app, then open again (status of previous uploaded photos changed to ok) then everything works ok (archive and delete).
Author
Owner

@lukanowa commented on GitHub (Aug 7, 2023):

This show problem:

Image

@lukanowa commented on GitHub (Aug 7, 2023): This show problem: ![Image](https://github.com/immich-app/immich/assets/110633111/af2aca3c-3d69-4503-96d6-e56091728d90)
Author
Owner

@tomlyo commented on GitHub (Sep 19, 2023):

I also am having this problem, not getting promoted to delete any local copy. V1.78.1

@tomlyo commented on GitHub (Sep 19, 2023): I also am having this problem, not getting promoted to delete any local copy. V1.78.1
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#326