Skip to content

Return typed APNSError for undecodable error bodies and add broadcast error reasons#253

Merged
kylebrowning merged 1 commit into
mainfrom
fix/error-handling-parity
Jul 14, 2026
Merged

Return typed APNSError for undecodable error bodies and add broadcast error reasons#253
kylebrowning merged 1 commit into
mainfrom
fix/error-handling-parity

Conversation

@kylebrowning

Copy link
Copy Markdown
Owner

Replaces #247 (closed during a base-branch cleanup).

  • The NIO clients threw a raw DecodingError/NIOTooManyBytesError when an APNs error body was empty, non-JSON, or oversized — losing the status code. They now return a typed APNSError with reason: nil, matching the URLSession client.
  • Adds Apple's 9 documented broadcast/channel error reasons (FeatureNotEnabled, MissingChannelId, BadChannelId, ChannelNotRegistered, BadRequestParams, BadRequestPayload, MissingPushType, CannotCreateChannelConfig, TopicMismatch).
  • Deprecates badEnvironmentKeyInToken (not a documented APNs reason); fixes the timestamp doc (accompanies any 410, not just Unregistered); apnsUniqueID is now let.
  • Test server: read/delete of a missing channel now returns Apple's documented 400 ChannelNotRegistered instead of a made-up 404.
  • New error-path tests (forced 500/503/429, empty/HTML/oversized bodies) via the server's response-override hook.

@kylebrowning kylebrowning merged commit 32a2d14 into main Jul 14, 2026
6 checks passed
@kylebrowning kylebrowning deleted the fix/error-handling-parity branch July 14, 2026 06:13
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.

1 participant