-
Notifications
You must be signed in to change notification settings - Fork 29
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 basic ESearch support #333
Draft
nevans
wants to merge
10
commits into
ruby:master
Choose a base branch
from
nevans:basic-esearch-support
base: master
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.
Draft
+1,777
−63
Conversation
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
FWIW: I discovered in testing that Yahoo does not return ESEARCH results when |
nevans
force-pushed
the
basic-esearch-support
branch
2 times, most recently
from
October 24, 2024 18:58
f31c61d
to
f20f5b4
Compare
This affects search, uid_search, sort, uid_sort, thread, and uid_thread. Prior to this, sending a parenthesized list in the search criteria for any of these commands required the use of strings, which are converted to RawData, which has security implications with untrusted inputs. With this change, arrays will only be converted into SequenceSet when _every_ element in the array is a valid SequenceSet input. Otherwise, the array will be left alone, which allows us to send parenthesized lists without using strings and RawData. For example, some search criteria this change enables: * `["not", %w[flagged unread]]` converts to `not (flagged unread)`. * `["return", ["partial", 1..50]]` converts to `return (partial 1:50)`.
Forward all `#search` and `#uid_search` arguments to `#search_internal`. This simplifies future changes to search parameters.
nevans
force-pushed
the
basic-esearch-support
branch
from
October 25, 2024 21:04
f20f5b4
to
59137e9
Compare
For new data structs, I'd prefer frozen by default and I don't want to support the entire Struct API. Data is perfect, but it's not available until ruby 3.2. So this adds a DataLite class that closely matches ruby 3.2's Data class, and it can be a drop-in replacement for Data. Net::IMAP::Data is an alias for Net::IMAP::DataLite, so when we remove our implementation, the constant will resolve to ruby's ::Data. Ideally, we wouldn't define this on newer ruby versions at all, but that breaks the YAML serialization for our test fixtures. The tests (and some of the implementation) have been copied from the polyfill-data gem and updated so that they use "Data" as it is resolved inside the "Net::IMAP" namespace. Copyright notices have been added to the appropriate files to satisfy the MIT license terms.
The command needs to know its own tag in order to filter responses based on it.
Parses +ESEARCH+ into ESearchResult, with support for: * RFC4466 syntax * RFC4731 `ESEARCH` * RFC5267 `CONTEXT=SEARCH` * RFC6203 `SEARCH=FUZZY` * RFC9394 `PARTIAL` For compatibility, `ESearchResult#to_a` returns an array of integers (sequence numbers or UIDs) whenever any `ALL` or `PARTIAL` result is available.
* Return empty ESearchResult when no result * Clear SEARCH responses before new search. Note that we don't need to do this for ESEARCH responses, since they are tagged.
nevans
force-pushed
the
basic-esearch-support
branch
from
October 25, 2024 21:21
59137e9
to
7dc2006
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.