Skip to content

♻️ Improve internal literal sending (partially backports #616, #649)#652

Merged
nevans merged 6 commits intov0.5-stablefrom
backport/v0.5/internally-support-non-synchronizing-literals
Apr 22, 2026
Merged

♻️ Improve internal literal sending (partially backports #616, #649)#652
nevans merged 6 commits intov0.5-stablefrom
backport/v0.5/internally-support-non-synchronizing-literals

Conversation

@nevans
Copy link
Copy Markdown
Collaborator

@nevans nevans commented Apr 22, 2026

This partially backports:

It backports most of the internal code and tests. However, it does not actually add BINARY support to #append, nor does it automatically send non-synchronizing literals. But it does add Literal8, and it adds a non_sync option to both Literal and Literal8.

nevans added 6 commits April 22, 2026 16:25
`Net::IMAP::Literal` is currently only used by `#append` and `#id`, but
more code will be refactored to use it in the (near?) future.
This adds the ability to send binary `literal8`, which were already
supported by the parser for `FETCH`.  It does *not* automatically use
`literal8` in `#append` when the message includes `NULL` bytes.
This tests literal sending a lot more thoroughly.  Most importantly,
this tests both continuation rejection and continuation request.

Added `literal_acceptor` proc to FakeServer, which returns if server
accepts specific literal continuation, and can be varied per test.
This is internal only, for now.  It is only used by `Literal` and
`Literal8`, and only when `non_synchronizing` is _explicitly_ set to
`true` or `false`.

`CommandData` only has a single `#data` attr, so this updates `Literal`
to no longer inherit from `CommandData`.

`non_synchronizing` is optional.  The intent is to make it tri-state:
* `true`  -> force non-synchronizing `LITERAL+`/`LITERAL-` behavior
* `false` -> force normal synchronizing literal behavior
* `nil`   -> dynamic behavior, based on capabilities and literal size

The `nil` behavior will be implemented in a separate commit.
I thought rdoc had fixed their endless method definition bugs with the
upgrade to using prism?
@nevans nevans added the backport This issue or PR is for a stable release branch label Apr 22, 2026
@nevans nevans merged commit 0b5b44c into v0.5-stable Apr 22, 2026
46 checks passed
@nevans nevans deleted the backport/v0.5/internally-support-non-synchronizing-literals branch April 22, 2026 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This issue or PR is for a stable release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant