[16.0][FIX] fetch...folder: use message uid's not sequence
When archiving messages, the messages get a new sequence through renumbering. To solve the problems this causes use the message uid's that are garanteed to remain constant for a message within a folder.
@zamberjo Can you have a look at this?
As highlighted in PR #3222, the reverse processing of emails aims to address a similar issue to the one you're working on here.
But I fail to see the exact modification you are doing in this PR to retreive UID instead of sequences. It's probably lost in all the variable renames.
@ikus060 I introduce the variable name message_uid instead of msgid, because it is a really different thing. msgid is basically the position of the message in the imap folder, and gets updated all the time because of insertions and deletions. message_uid however is constant (as long as the message remains in the same folder). However to work with the uid's the methods to work with messages are replaced by a single method on the connection, uid, with the original methodname as the first parameter: connection.uid("search", charset, criteria) connection.uid("fetch", message_uid, "(RFC822)") ... Working with the message_uid's is intrinsically more reliable...
ok, I see connection.uid("search", charset, criteria) vs connection.search(None, criteria)
I've missed that while looking at the changes. Thanks for pointing the changes.
This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖
/ocabot merge minor
On my way to merge this fine PR! Prepared branch 16.0-ocabot-merge-pr-3017-by-NL66278-bump-minor, awaiting test results.
Congratulations, your PR was merged at 141d0a25b3cea648c4b8f207aa444b81c33fb3a8. Thanks a lot for contributing to OCA. ❤️