Skip to content

fix: Delete local folder when API returns a success#2967

Open
Elouan1411 wants to merge 2 commits into
mainfrom
delete-folder
Open

fix: Delete local folder when API returns a success#2967
Elouan1411 wants to merge 2 commits into
mainfrom
delete-folder

Conversation

@Elouan1411

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings June 30, 2026 11:21

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to keep the local mailbox content cache consistent with the server by deleting the locally cached folder immediately after the folder deletion API call succeeds.

Changes:

  • In MainViewModel, delete the local folder from the Realm cache when the API delete call succeeds (before refreshing folders).
  • In FolderController, add a new deleteFolder(id, mailbox) helper to remove a folder from the local mailbox-content Realm.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
app/src/main/java/com/infomaniak/mail/ui/MainViewModel.kt Calls local cache deletion on successful folder deletion API response, then refreshes folders.
app/src/main/java/com/infomaniak/mail/data/cache/mailboxContent/FolderController.kt Introduces a local deleteFolder method that deletes a folder from the mailbox-content Realm.

@sonarqubecloud

sonarqubecloud Bot commented Jul 6, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants