Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Guarantee immediate message deletion if delete_server_after == 0 (#5201) #5252

Merged
merged 1 commit into from
Feb 7, 2024

Conversation

iequidoo
Copy link
Collaborator

@iequidoo iequidoo commented Feb 7, 2024

This should fix most of the failures of test_verified_group_vs_delete_server_after(). But sometimes it fails in a different way, maybe we have some race in IMAP handling (see #5201 (comment)), so let's leave the issue open for now.

EDIT: Looks like this should be tested in the Rust test test_delete_expired_imap_messages().

@iequidoo iequidoo marked this pull request as ready for review February 7, 2024 04:54
@iequidoo iequidoo merged commit fba27ff into main Feb 7, 2024
38 checks passed
@iequidoo iequidoo deleted the iequidoo/delete_expired_imap_messages branch February 7, 2024 14:43
@iequidoo
Copy link
Collaborator Author

iequidoo commented Feb 7, 2024

Merging w/o a test to fix CI, will add the test soon

@adbenitez
Copy link
Member

I am a bit confused, doesnt delete_server_after == 0 mean "do not delete, never delete" why should it be guaranteed that messages are deleted immediately? 🤔

@iequidoo
Copy link
Collaborator Author

iequidoo commented Feb 7, 2024

I am a bit confused, doesnt delete_server_after == 0 mean "do not delete, never delete" why should it be guaranteed that messages are deleted immediately? 🤔

You're right, 0 is interpreted as None and this means "never delete":

    pub async fn get_config_delete_server_after(&self) -> Result<Option<i64>> {                                                                                                                                      
        match self.get_config_int(Config::DeleteServerAfter).await? {
            0 => Ok(None),
            1 => Ok(Some(0)),
            x => Ok(Some(i64::from(x))),
        }
    }

Probably, the commit message should say Some(0) instead of 0, but it's already merged :)

@adbenitez
Copy link
Member

Thanks for explaining 👍

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.

None yet

3 participants