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

Download new messages based on Date on UID validity change #5774

Open
link2xt opened this issue Jul 14, 2024 · 0 comments
Open

Download new messages based on Date on UID validity change #5774

link2xt opened this issue Jul 14, 2024 · 0 comments

Comments

@link2xt
Copy link
Collaborator

link2xt commented Jul 14, 2024

When UID validity changes, Delta Chat schedules resync to update UIDs stored in the imap table:

pub(crate) async fn resync_folder_uids(

However, it does not download any messages that arrived between previous fetch and detecting that UID validity changed.

When UID validity change is detected, Delta Chat should download all messages that have Date higher than the highest message timestamp observed so far.

I thought about using INTERNALDATE, but this can be changed if admins carelessly copy mailbox to a new server without preserving timestamps and all archived messages become "new". This is likely to happen together with UID validity change. Even if this is quickly detected, Delta Chat clients would have already downloaded all messages cluttering the chatlist and wasting traffic.

Currently resync_folders happens on the INBOX loop, this is not a place to download messages e.g. from Delta Chat folder, so first of all resync_request variable should be removed and resyncing UIDs should be integrated directly into the fetch procedure. When folder is fetched and UID validity is known to have changed since last fetch, all messages should be prefetched, UIDs of known messages updated because of known Message-ID and new messages are downloaded based on Date.

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

No branches or pull requests

1 participant