-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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 email collector datetimelast ok and email fetching #32456
Open
Hystepik
wants to merge
4
commits into
Dolibarr:develop
Choose a base branch
from
Hystepik:fix-email-collector
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We must keep the order "asc" because we must process the email from the older one to the new one. In same order than they are received.
Does the fix change if we restore "asc" ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes as said in the description if we set setFetchOrder as asc the mail are not proceed the same way.
For exmple we want 2 mails to be proceed in a mail chain of 10 mails sent
And if we proceed the 10 emails of the mail chain then if we set desc or asc is the same
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strange. I have got the opposite :
I have 1 email on 19 dec and another one of 20 dec.
If i set limit to 10, the result is the same, i agree.
But if i set limit to 1, i get the email of the 19 dec when sort is asc, and i get the 20 dec if sort is asc.
So on my side, I need asc.
According to this Webklex/php-imap#71, the sort is to define which bloc to receive when the limit is spliting the result into several blocks. According to exemple in this issue, when whe use the sort desc, we got the last recent block. And we want the older block.
So my result matches the explanation and the example of weklex. If max limit is higher than the number of results, then the sort has no effect. But if the max limit is lower, then we should use asc to get the block that is lower so older emails (the date that is the lower).
What weblex and its example says is that, inside a bloc, the sorting is always asc (great this is what we want), so trouble is only to get the oldest bloc when number of record is higher than limit.
And according to tests done with a block of 1, 'asc' means the last ancient block when there is several blocks.
We may contact each other later to make test on a real environment to see why you got a different behaviour...