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

Sequence iterator does not resolve reverse order ranges #411

Closed
4 tasks done
superboum opened this issue Jan 9, 2024 · 1 comment · Fixed by #416
Closed
4 tasks done

Sequence iterator does not resolve reverse order ranges #411

superboum opened this issue Jan 9, 2024 · 1 comment · Fixed by #416

Comments

@superboum
Copy link
Contributor

superboum commented Jan 9, 2024

Observation

Given the following sequence set: 22,21,22,*:20 and a last message with id=23.
I expect to get: 20, 21, 22, 23 (in any order)
I am currently getting: 22, 21, 22 (23 and 20 are missing as the reverse order range is skipped, no deduplication is performed and thus 22 appears twice)

Remarks

  • ❌ When sequences are in reverse order, they are skipped instead of being resolved. It's not compliant with RFC3501
  • ℹ️ The identifiers might de-duplicated but it's not mandatory. It could be the subject of an optimized/specific iterator.
  • ℹ️ The identifiers might be sorted but it's not mandatory. It could be the subject of an optimized/specific iterator.
  • ℹ️ The resolve logic is not intuitive, giving an example in the documentation showing all the ways the iterator can breaks the "least astonishment principle" would greatly help ^^

(Feel free to close this issue as long as the reverse order range is fixed, the other parts are for informational purpose only).

References

Relevant to reverse order ranges:

Example: 2:4 and 4:2 are equivalent and indicate values 2, 3, and 4.

From IMAP4rev1

Relevant to de-duplication and re-ordering:

Set of seq-number values, regardless of order. Servers MAY coalesce overlaps and/or execute the sequence in any order.
Example: a message sequence number set of 2,4:7,9,12:* for a mailbox with 15 messages is equivalent to 2,4,5,6,7,9,12,13,14,15

Example: a message sequence number set of *:4,5:7 for a mailbox with 10 messages is equivalent to 10,9,8,7,6,5,4,5,6,7 and MAY be reordered and overlap coalesced to be 4,5,6,7,8,9,10.

From IMAP4rev2

@superboum superboum changed the title Sequence iterator does not resolve reverse order ranges RFC9051 Sequence iterator does not resolve reverse order ranges Jan 9, 2024
duesee added a commit that referenced this issue Jan 9, 2024
duesee added a commit that referenced this issue Jan 9, 2024
duesee added a commit that referenced this issue Jan 9, 2024
@duesee
Copy link
Owner

duesee commented Jan 10, 2024

I converted your list to items. All resolved by #416 :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants