fix(apns): handling of the certificate expiration error#364
Merged
geekbrother merged 2 commits intomainfrom May 29, 2025
Merged
fix(apns): handling of the certificate expiration error#364geekbrother merged 2 commits intomainfrom
geekbrother merged 2 commits intomainfrom
Conversation
geekbrother
commented
May 20, 2025
| // Note: Should we pass this error back up? | ||
| Err(_e) => None, | ||
| }; | ||
| let public_ip = networking::find_public_ip_addr().ok(); |
Contributor
Author
There was a problem hiding this comment.
Fixing clippy error.
There was a problem hiding this comment.
Pull Request Overview
This PR introduces handling for APNS CertificateExpired errors and simplifies public IP lookup.
- Simplify
public_ipassignment by using.ok() - Add a new match arm for
CertificateExpiredin the APNS provider
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/state.rs | Replace manual match with .ok() for public IP |
| src/providers/apns.rs | Add explicit handling for CertificateExpired alerts |
Comments suppressed due to low confidence (3)
src/providers/apns.rs:178
- [nitpick] Using
dbgas a variable name can be confused with thedbg!macro. Rename this binding to something more descriptive, likedebug_msg.
dbg if dbg.contains("received fatal alert: CertificateExpired") => {
src/providers/apns.rs:175
- New error variant
ApnsCertificateExpiredis introduced but there are no tests for this branch. Consider adding a unit test that simulates theCertificateExpiredresponse.
impl PushProvider for ApnsProvider {
src/providers/apns.rs:179
- The
client_erroridentifier isn't in scope here and named placeholders aren't supported byinfo!. You likely need to reference the correct error variable and use{}formatting with positional arguments.
info!("APNs certificate expired: debug:{dbg}, display: {client_error}");
nopestack
approved these changes
May 20, 2025
chris13524
approved these changes
May 20, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds proper handling of the
received fatal alert: CertificateExpiredAPNS error.How Has This Been Tested?
Not tested.
Due Diligence