8000 [16.0][FIX] fetch...folder: use message uid's not sequence by NL66278 · Pull Request #3017 · OCA/server-tools · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[16.0][FIX] fetch...folder: use message uid's not sequence #3017

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

Merged

Conversation

NL66278
Copy link
Contributor
@NL66278 NL66278 commented Aug 22, 2024

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.

@NL66278 NL66278 force-pushed the 16.0-fetchmail_attach_from_folder-use-uid branch from 4b32c32 to b6d4114 Compare August 22, 2024 15:00
@NL66278
Copy link
Contributor Author
NL66278 commented Aug 22, 2024

@zamberjo Can you have a look at this?

Copy link
Member
@zamberjo zamberjo left a comment

Choose a reason for hiding this comment

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

Technically it seems correct, I have not been able to test it functionally.

Copy link
@anmarmo1 anmarmo1 left a comment

Choose a reason for hiding this comment

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

I am not clear about the initial problem that this change solves, but, the initial functionality is still correct, so for me the change is correct.

@ikus060
Copy link
ikus060 commented Mar 7, 2025

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.

@NL66278
Copy link
Contributor Author
NL66278 commented Mar 7, 2025

@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...

@ikus060
Copy link
ikus060 commented Mar 7, 2025

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.

@NL66278 NL66278 force-pushed the 16.0-fetchmail_attach_from_folder-use-uid branch from 7b95d09 to 02e69ba Compare April 29, 2025 10:25
@OCA-git-bot
Copy link
Contributor

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). 🤖

@NL66278
Copy link
Contributor Author
NL66278 commented May 1, 2025

/ocabot merge minor

@OCA-git-bot
Copy link
Contributor

On my way to merge this fine PR!
Prepared branch 16.0-ocabot-merge-pr-3017-by-NL66278-bump-minor, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 664b681 into OCA:16.0 May 1, 2025
9 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at 141d0a2. Thanks a lot for contributing to OCA. ❤️

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.

5 participants
0