Skip to content

Support APNSwift 7.0.1 and modernise the package - #62

Open
kylebrowning wants to merge 5 commits into
mainfrom
apnswift-7
Open

Support APNSwift 7.0.1 and modernise the package#62
kylebrowning wants to merge 5 commits into
mainfrom
apnswift-7

Conversation

@kylebrowning

@kylebrowning kylebrowning commented Aug 12, 2026

Copy link
Copy Markdown
Member

Motivation

VaporAPNS was capped at APNSwift 6.x, and the package predated the current Vapor tooling baseline.

Modifications

  • Require APNSwift 7.0.1, which links FoundationEssentials rather than full Foundation.
  • Raise the manifest to Swift tools 6.2 with the standard Vapor swift settings; declare tvOS 16 and watchOS 9.
  • Consolidate the test helpers into TestUtilities.swift and await application shutdown rather than racing it in a detached Task.
  • Enable linting, musl and iOS in CI; add dependency submission and the shared .swift-format config.

Result

Builds and tests pass on macOS, Linux (6.2 and 6.3), musl and iOS.

api-breakage reports four nonisolated changes on Application.APNS from NonisolatedNonsendingByDefault. Intended, and why this warrants a major release.

The dependency was pinned to `from: "6.1.0"`, which SPM resolves as
>=6.1.0 <7.0.0, so VaporAPNS could not pick up APNSwift 7. No source
changes are needed: the package builds and the full test suite passes
against 7.0.0 unchanged.

Also refreshes two doc comments that referenced APIs deprecated in
APNSwift 7:

- `P256.Signing.PrivateKey.loadFrom(string:)` is deprecated in favor of
  `init(pemRepresentation:)`
- `APNSEnvironment.sandbox` is deprecated in favor of `.development`

@0xTim 0xTim left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should update CI for the latest changes and bump the swift version to 6.1. There are. also a number of changes we want to make, I don't know if we want to do a major version release now or wait

@kylebrowning

Copy link
Copy Markdown
Member Author

IM happy to do them now. What did you have in mind?

@0xTim

0xTim commented Aug 12, 2026

Copy link
Copy Markdown
Member

See Modernisation for the list!

Raise the tools version to 6.2 and adopt the standard Vapor swift
settings on both targets. InternalImportsByDefault and
MemberImportVisibility account for the import changes; APNSCore becomes
an explicit dependency because APNSEnvironment's members are declared
there and APNS doesn't re-export it.

Declare tvOS 16 and watchOS 9, both already supported by APNSwift and
Vapor.

De-duplicate the test helpers into TestUtilities.swift, and await
application shutdown rather than detaching it into a Task that raced the
teardown it was meant to perform.

Enable linting, musl and iOS in CI, add dependency submission, and add
the shared .swift-format config.
@codecov

codecov Bot commented Aug 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@792a487). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #62   +/-   ##
=======================================
  Coverage        ?   92.22%           
=======================================
  Files           ?        4           
  Lines           ?       90           
  Branches        ?        0           
=======================================
  Hits            ?       83           
  Misses          ?        7           
  Partials        ?        0           
Files with missing lines Coverage Δ
Sources/VaporAPNS/APNSContainerID.swift 100.00% <ø> (ø)
Sources/VaporAPNS/APNSContainers.swift 86.84% <100.00%> (ø)
Sources/VaporAPNS/Application+APNS.swift 95.45% <ø> (ø)
Sources/VaporAPNS/Request+APNS.swift 100.00% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread Sources/VaporAPNS/APNSContainers.swift Outdated
JSONEncoder and JSONDecoder are Sendable in corelibs-foundation as of
Swift 6.2, so the @preconcurrency import is unnecessary — and it fails
StrictMemorySafety, which broke the Linux and musl builds.
7.0.1 links FoundationEssentials rather than full Foundation, which
vapor/apns needs before the Foundation linking check can be enabled.
@kylebrowning kylebrowning changed the title Support APNSwift 7.0.0 Support APNSwift 7.0.1 and modernise the package Aug 14, 2026
@kylebrowning
kylebrowning requested a review from 0xTim August 14, 2026 19:02
Comment thread Package.swift Outdated
Co-authored-by: Francesco Paolo Severino <96546612+fpseverino@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants