Skip to content

🐛 Fix empty SearchResult#to_sequence_set#644

Merged
nevans merged 2 commits into
masterfrom
fix-empty-search_result-to_sequence_set
Apr 17, 2026
Merged

🐛 Fix empty SearchResult#to_sequence_set#644
nevans merged 2 commits into
masterfrom
fix-empty-search_result-to_sequence_set

Conversation

@nevans

@nevans nevans commented Apr 17, 2026

Copy link
Copy Markdown
Collaborator

This provides the same behavior as ESearchResult (except it still doesn't preserve SORT order).

Fixes #641.

nevans added 2 commits April 17, 2026 11:07
This provides the same behavior as `ESearchResult`.

Fixes #641.
This is, unfortunately, different from ESearchResult#to_sequence_set's
behavior, since ESearchResult simply returns the SequenceSet as provided
by the server.

I would like to update this in a future release (perhaps 0.7).
@nevans nevans added the bug Something isn't working label Apr 17, 2026
@nevans nevans merged commit 36ecc26 into master Apr 17, 2026
39 checks passed
@nevans nevans deleted the fix-empty-search_result-to_sequence_set branch April 17, 2026 15:21
@nevans nevans changed the title 🐛 Fix empty search result to sequence set 🐛 Fix empty SearchResult#to_sequence_set Apr 17, 2026
nevans added a commit that referenced this pull request Jun 5, 2026
The premature tagged response guard that was added for #644 only checked
for premature `OK`, not for premature `BAD` or `NO`.  When those are
detected prior to the tag being sent, this treats those cases as the
same sort of error.

Note that this explicitly raises a "closed stream" IOError when
disconnected.  This is the error that would be raised anyway, if
`send_command` were allowed to write to the connection.  But, if we can
test that the socket is already closed, we can raise the error directly.
There's no need to attempt to format and send data.
nevans added a commit that referenced this pull request Jun 8, 2026
The premature tagged response guard that was added for #644 only checked
for premature `OK`, not for premature `BAD` or `NO`.  When those are
detected prior to the tag being sent, this treats those cases as the
same sort of error.

Note that this explicitly raises a "closed stream" IOError when
disconnected.  This is the error that would be raised anyway, if
`send_command` were allowed to write to the connection.  But, if we can
test that the socket is already closed, we can raise the error directly.
There's no need to attempt to format and send data.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Net::IMAP::SearchResult#to_sequence_set raises ArgumentError for empty Net::IMAP::SearchResult

1 participant