Skip to content

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

Closed
kylebrowning wants to merge 1 commit into
feat/test-server-parityfrom
fix/error-handling-parity
Closed

Return typed APNSError for undecodable error bodies and add broadcast error reasons#247
kylebrowning wants to merge 1 commit into
feat/test-server-parityfrom
fix/error-handling-parity

Conversation

@kylebrowning

Copy link
Copy Markdown
Owner

Stacked on #246; will be retargeted to main once it merges.

  • 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.

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