Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor configuration and client #143

Merged

Conversation

FranzBusch
Copy link
Contributor

Motivation

This PR is doing multiple things in once and I can't split them apart since the client and the configuration are tightly coupled. The goals of this PR is to create an evolable API that we can use to build more semantically safe constructs. Furthermore, it splits the configuration properly between what can be configured on a single connection and what can be configured on a request.

Modification

In details this PR does the following things:

  1. Every type that is touched in this PR should be forward evolable without API breakage. Therefore, all enums are converted to struct
  2. The current configuration mixes configs from the connection and single requests. The new proposed config splits them between the two types.
  3. Introduce a new error struct that contains semantic information and more debug information
  4. Makes the client generic over the encoder/decoder and introduces a new low level send method.

Result

We now have a new config and a baseline client that allows us to build semantically safe APIs in the next PRs.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
# Motivation
This PR is doing multiple things in once and I can't split them apart since the client and the configuration are tightly coupled. The goals of this PR is to create an evolable API that we can use to build more semantically safe constructs. Furthermore, it splits the configuration properly between what can be configured on a single connection and what can be configured on a request.

# Modification
In details this PR does the following things:

1. Every type that is touched in this PR should be forward evolable without API breakage. Therefore, all enums are converted to struct
2. The current configuration mixes configs from the connection and single requests. The new proposed config splits them between the two types.
3. Introduce a new error struct that contains semantic information and more debug information
4. Makes the client generic over the encoder/decoder and introduces a new low level `send` method.

# Result
We now have a new config and a baseline client that allows us to build semantically safe APIs in the next PRs.
}

do {
// TODO: Send pushes once semantic APIs land
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This will be resolved in a follow-up PR

Sources/APNSwift/APNSClient.swift Outdated Show resolved Hide resolved
Sources/APNSwift/APNSErrorResponse.swift Show resolved Hide resolved
Sources/APNSwift/Coding/APNSJSONDecoder.swift Show resolved Hide resolved

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Co-authored-by: Kyle Browning <kylebrowning@me.com>
@kylebrowning kylebrowning merged commit 43c55b9 into swift-server-community:main Aug 25, 2022
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.

None yet

2 participants