Skip to content

fix(mobile): asset deletion state management - #4568

Merged
alextran1502 merged 2 commits into
mainfrom
fix/mobile-asset-delete
Oct 25, 2023
Merged

alextran1502 merged 2 commits into
mainfrom
fix/mobile-asset-delete

Conversation

@shenlong-tanwen

Copy link
Copy Markdown
Member

Changed made in the PR

  • The previous handling removed local assets from DB even if the user denied the System prompt which is undesirable. This resulted in few different scenarios where the actual state of the asset is different from the one maintained in the DB.

    Few such cases:

    • User denied system prompt, but the asset is still removed from DB since remoteDeleted will not be empty
    • User accepts system prompt, but the deletion is soft. If we go to trash, the indicator would still display cloud with check mark whereas it should display cloud only indicator

    These are handled in the updated handling.

  • During sync, remote deleted asset details were not removed from ExifInfo table which is properly cleaned now.

  • Emptying trash removed local assets without asking a prompt. The state is now properly updated to mark them as not backed up instead.

@vercel

vercel Bot commented Oct 20, 2023 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
immich ⬜️ Ignored (Inspect) Visit Preview Oct 22, 2023 8:52am

@fyfrey fyfrey left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this certainly improves the delete handling + robustness. I've found two small code optimization opportunities

Comment thread mobile/lib/modules/trash/providers/trashed_asset.provider.dart Outdated
Comment thread mobile/lib/shared/providers/asset.provider.dart Outdated
@alextran1502
alextran1502 merged commit 52e09b4 into main Oct 25, 2023
@alextran1502
alextran1502 deleted the fix/mobile-asset-delete branch October 25, 2023 16:03
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.

3 participants