immich-app / immich

High performance self-hosted photo and video management solution.
https://immich.app
GNU Affero General Public License v3.0
49.64k stars 2.62k forks source link

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

Closed J4gQBqqR closed 1 year ago

J4gQBqqR commented 2 years ago

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.

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:

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

System

Additional context Add any other context about the problem here.

alextran1502 commented 2 years ago

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.

J4gQBqqR commented 2 years ago

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?

alextran1502 commented 2 years ago

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?

J4gQBqqR commented 2 years ago

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

alextran1502 commented 2 years ago

Hmm, thank you I will take a look

alextran1502 commented 2 years ago

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?

J4gQBqqR commented 2 years ago

gif-20220922-213229

alextran1502 commented 2 years ago

gif-20220922-213229 gif-20220922-213229

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

J4gQBqqR commented 2 years ago

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

alextran1502 commented 2 years ago

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

Nonobis commented 2 years ago

hello, i have the same problem

JVT038 commented 1 year ago

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.

jrasm91 commented 1 year ago

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.

simone-viozzi commented 1 year ago

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?"

lukanowa commented 1 year ago

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 1 year ago

This show problem:

Image

tomlyo commented 1 year ago

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