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

✨ Add support for VANISHED responses #329

Merged
merged 2 commits into from
Dec 17, 2024
Merged

✨ Add support for VANISHED responses #329

merged 2 commits into from
Dec 17, 2024

Conversation

nevans
Copy link
Collaborator

@nevans nevans commented Sep 25, 2024

VANISHED responses are required by two different extensions: QRESYNC and UIDONLY.

  • Add a new response data type: VanishedData, which wraps SequenceSet and the EARLIER modifier.
  • Update the parser to handle the VANISHED response => VanishedData
  • Update #expunge and #uid_expunge to return VANISHED (without the EARLIER modifier) responses, when they are present.
    • There is a TODO note on this: For consistency, if either of the above extensions are enabled, we should return an empty VanishedResponse when the commands have no result. Currently, an empty array is returned.

Although neither extension is completely supported yet, they can both be (partially) used in a way that doesn't crash... so I think this is a reasonable chunk to extract into its own PR, rather than wait for a PR for either of them to be 100% ready.

@nevans
Copy link
Collaborator Author

nevans commented Sep 25, 2024

Note that this PR is based on #330.

@nevans nevans added this to the v0.6 milestone Oct 8, 2024
@nevans nevans force-pushed the vanished branch 2 times, most recently from 01f70d2 to 6649519 Compare October 25, 2024 21:09
@nevans nevans force-pushed the vanished branch 3 times, most recently from 0d7d6b6 to c7b54bf Compare November 8, 2024 23:02
This updates the parser to handle the VANISHED response, and adds a new
response data class: VanishedData.

VanishedData was originally written as a plain class and then converted
to Data.  I'm keeping most of the tests that I wrote prior to converting
it to Data, but I probably wouldn't have written many of them if I had
used Data in the first place.
@nevans nevans marked this pull request as ready for review December 16, 2024 17:14
lib/net/imap.rb Outdated Show resolved Hide resolved
lib/net/imap.rb Outdated Show resolved Hide resolved
Both the `QRESYNC` and `UIDONLY` extensions replace `EXPUNGE` responses
with `VANISHED` responses.  This updates the #expunge and #uid_expunge
commands to return VanishedData, rather than a (misleading) empty array.
@nevans nevans merged commit 6a520fb into ruby:master Dec 17, 2024
13 checks passed
@nevans nevans deleted the vanished branch December 17, 2024 07:18
@nevans nevans added the enhancement New feature or request label Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

Successfully merging this pull request may close these issues.

1 participant