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

JAMES-3715 Tests and fix for IMAP partial Fetch #893

Merged
merged 2 commits into from
Mar 1, 2022

Conversation

chibenwa
Copy link
Contributor

  1. Introduces unit tests for IMAP partial fetch. Those are not working properly after the Netty 4 migration cf [JAMES-3715] upgrade to netty 4.1.72.Final #886 (comment)

  2. I discovered a bug where a ridicoulously high size is reproded for partial fetches with an offset and no limit (close to Long.MAX) that IMAP clients are not able to handle. This is due to the use of Long.MAX_VALUE to represent absence and causes mis-calculations down the line. Fixed with the use of Optionals...

Under some circumstances those broke with Netty4 and the little test
suite introduced here reliably demonstrates this.

Furthermore, we identified an issue regarding partial fetch when only
the offset is specified. This is due to the usage of Long.MAX_VALUE to
represent absence, and that causes some mis-calculations down the line.
This makes the behaviour explicit and prevents mis-calculations down the
line, and solves partial fetchs with only the offset (commons-net IMAP
stack is happy...)
@chibenwa chibenwa merged commit c308748 into apache:master Mar 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants