## Motivation
- Users need to be able to create HPACKHeaders to pass into library such
as GRPC v1
- To create them, without relying on SPM weirdness, users should be
importing NIOHPACK
- To import NIOHPACK without relying on SPM weirdness, users should be
depending on NIOHPACK in Package.swift
- Users currently cannot depend on NIOHPACK in Package.swift, because
NIOHPACK is not a product
## Changes
Make NIOHPACK a product
Motivation
* `@main` references to `swiftlang/github-workflows` are deprecated.
Modifications
* Replace `@main` with `@0.0.7` in all workflow files.
Result
* Workflow files reference a pinned version of
`swiftlang/github-workflows`.
The codec now caches the most recent outbound frame and only writes it
on flush or when receiving `.end`. This lets us set `endStream=true` on
the final data or headers frame instead of sending a separate empty data
frame.
Changes:
- Introduced `PendingFrameWrite` to cache frame payload and promise
- Modified `processOutboundData` to return optional frames instead of
writing immediately
- Added `flush()` method to both client codecs to handle cached writes
- Promise merging ensures correct completion notification when combining
frames
Motivation:
The nightly CI checks for Integration Tests started failing since run
https://github.com/apple/swift-nio-http2/actions/runs/19310336168/job/55228659542
(on 12 November 2025) due to multiple allocation benchmark tests
exceeding their allocation thresholds.
The date these failures started coincides with [release 2.89.0 of
`swift-nio`](https://github.com/apple/swift-nio/releases/tag/2.89.0). In
particular, all failing allocation benchmarks use `EmbeddedChannel`, and
`EmbeddedChannel` was changed in [a PR contained in that
release](https://github.com/apple/swift-nio/pull/3442) that introduced
some changes leading to greater allocations.
[Another change to
`EmbeddedChannel`](https://github.com/apple/swift-nio/pull/3495) in
`swift-nio`'s latest release
([2.94.0](https://github.com/apple/swift-nio/releases)) has also
increased the number of allocations in benchmarks using
`EmbeddedChannel`.
As such, we should update the allocation thresholds for affected tests
accordingly.
Modifications:
Updated the allocation threshold for all affected tests across all
versions.
Result:
Integration tests should no longer fail.
Motivation:
* More secure GitHub Actions workflows
Modifications:
Add explicit 'contents: read' permissions to workflows that did not have
explicit permissions defined. This follows GitHub Actions security best
practices by limiting the default GITHUB_TOKEN permissions.
Result:
An extra layer of security.
Motivation:
Swift 6.2 has been released, we should add it to our CI coverage.
Modifications:
Add additional Swift 6.2 jobs where appropriate in main.yml,
pull_request.yml
Result:
Improved test coverage.
### Motivation:
Some errors do not show up in debug builds. Enabling release mode builds
improves the CI coverage.
### Modifications:
Enable release mode builds for pull requests and scheduled builds on
main.
### Result:
Improved CI coverage.
Motivation:
Frames written from a child channel may not be written immediately by
the connection channel. For example, a DATA frame written on a stream
may be larger than the max frame size imposed on the connection and so
the connection channel will have to slice it into multiple frames. Or
the connection may not be writable and may delay the transmission of the
frame. This behaviour isn't currently observable but is useful to know
about.
Modifications:
- Add a frame delegate which is notified when certain frames are written
by the connection channel.
Result:
Users can observer when headers and data frames are written into the
connection channel.
Motivation:
Swift 5.9 is no longer supported, we should bump the tools version and
remove it from our CI.
Modifications:
* Bump the Swift tools version to Swift 5.10
* Remove Swift 5.9 jobs where appropriate in main.yml, pull_request.yml
Result:
Code reflects our support window.
---------
Co-authored-by: George Barnett <gbarnett@apple.com>
Motivation:
We added a couple of shims which were upstreamed to swift-nio and were
released in 2.82.0.
Modifications:
- Bump minimum verison of swift-nio
- Remove shims
Result:
Less code
Motivation:
Swift 6.1 has been released, we should add it to our CI coverage.
Modifications:
Add additional Swift 6.1 jobs where appropriate in main.yml,
pull_request.yml
Result:
Improved test coverage.
### Motivation:
To remove all uses of the older workflow so it can be removed to
simplify the workflows.
### Modifications:
* Switch h2Spec tests to use the newer Swift test matrix workflow,
`swift_test_matrix.yml`
### Result:
This should make no difference to the running of h2Spec tests.
Motivation:
* Improve test coverage
Modifications:
Enable macOS CI to be run on pull request commits and make the use of
the nightly runner pool for main.yml jobs explicit.
Result:
Improved test coverage.
Motivation:
The HTTP2StreamMultiplexer isn't `Sendable`, but it has public API for
creating streams which must operate from off of the `EventLoop`.
Modifications:
- Add a `SendableView` over the multiplexer which only provides the
methods for creating streams. These are safe to call from any isolation
domain.
Result:
Can create streams from off of the EL.
Motivation:
To increase concurrency safety the NIOHTTP2 module should compile
without warning under strict concurrency checking.
Modifications:
- Add a few temporary internal helpers
- Annotate the pipeline helpers
Result:
Fewer concurrency warnings
Co-authored-by: Rick Newton-Rogers <rnro@apple.com>
Enable macOS CI on merge to main and daily timer
### Motivation:
* Improve test coverage
* Check test pass/fail status
* Monitor CI throughput
### Modifications:
Enable macOS CI to be run on all merges to main and on a daily timer.
### Result:
Improved test coverage run out-of-band at the moment so we can get a
feeling for if any changes need to be made in the repo or in the CI
pipelines to ensure timely and stable checks.
Motivation:
To increase concurrency safety the NIOPHACK module should compile
without warning under strict concurrency checking.
Modifications:
- Add explicit Sendable annotations
Result:
No concurrency warnings.
Update main.yml integration tests to use `swift_test_matrix` as has been
done on the PR workflow. This brings it off the deprecated workflow and
should fix the nightly-6.1 issue
Motivation:
The maximum number of recently reset stream frames to track is limited
to a fixed value of 32. This should be configurable.
Modifications:
- Add it to the connection config and propagate it through
Result:
- Resolves#493
Motivation:
When the server is in the locally quiescing state and a client attempts
to open a new stream, the connection state machine treats receiving the
headers as a connection error. This results in the connection being
closed and in-flight requests being failed.
This can happen because of the inherent race between the server sending
a GOAWAY frame and the client receiving it, during which time the client
can open a stream not knowing it's doomed to failure.
Rather than the server treating this as a connection error, it should
reject the stream with a RST_STREAM frame and emit a stream error.
Modifications:
- Emit a stream error when receiving HEADERS in the locally quiesced
state
Result:
Better handling of new streams when the server is quiescing
Strictly speaking, a `close` operation can't really fail (except when
the closing mode isn't supported or the channel is already closed). Even
if an error is encountered while closing a channel, or if an error
caused the channel to be closed, the end result is the same: the channel
will be closed.
In this case in particular, when streams are closed from the client
(i.e. by sending a RST_STREAM frame) the `HTTP2StreamChannel` would fail
the channel's `closeFuture`. This isn't appropriate however, as the
channel is successfully closed.
This change stops failing the stream channel's `closeFuture`. Instead,
if the close happens uncleanly, the error will be fired down the
pipeline and the `close` method's promise will be failed.
Enable MemberImportVisibility check on all targets. Use a standard
string header and footer to bracket the new block for ease of updating
in the future with scripts.
## Motivation
Currently, the multiplexer's inbound streams stream is finished only
when the channel becomes inactive.
There are some scenarios in which the channel may be closed before it
has a chance to become active, and the stream will never be finished.
This can cause any users iterating over the stream to hang.
## Modifications
This PR finishes the inbound streams stream when a connection error is
fired, and when the handler is removed.
## Result
Fewer bugs.
In the async HTTP2 pipeline there is no way to account for the opening
and closing of streams. This PR adds a variant of
`configureAsyncHTTPServerPipeline` (HTTP2 upgrade channel) that allows
the user to pass in a `NIOHTTP2StreamDelegate` to be applied to the
HTTP2 channel if the upgrade occurs.
This is similar to #439 which did the same HTTP2 only channels.
I added the `Bionic` import this summer in #448 and the compiler
accepted it then, but it started erroring a couple months later without
this full Android overlay, so add that instead.
Motivation:
Complete enablement of all standard GitHub Actions workflows.
Modifications:
Describe the modifications you've done.
Result:
After your change, what will change.
Motivation:
Testing is good - we should check results on PRs.
Modifications:
Add integration tests to PR and scheduled GitHub Actions workflows.
Result:
Integration tests run.
Motivation:
More testing is better.
Modifications:
Setup github actions to run http/2 spec tests.
Result:
Testing against http/2 spec occurs on pull requests