[codex] Preserve APNs delivery failure context#3475
Conversation
Co-authored-by: codex <codex@users.noreply.github.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
ApprovabilityVerdict: Approved This PR adds structured error logging for APNs delivery failures without changing the actual failure handling behavior. The errors are still caught and converted to the same failure result - only the logging context is enriched for better observability. You can customize Macroscope's approvability policy. Learn more. |
Co-authored-by: codex <codex@users.noreply.github.com>
Dismissing prior approval to re-evaluate 80348b8
Co-authored-by: codex <codex@users.noreply.github.com>
Summary
Verification
Note
Low Risk
Scoped to known
Apnserror tags with unchanged delivery outcomes and attempt persistence; only observability and error shape change on the relay push path.Overview
APNs transport failures (JWT encoding/signing and HTTP request errors) are now wrapped in
ApnsDeliveryTransportErrorwith device, delivery kind, job id, APNs error tag, and HTTP stage, while the original client error stays oncause.recoverApnsDeliveryTransportErrorlogs viaEffect.logErrorwith structured fields and a redactederrorannotation holding the full object; callers still get the sameok: false, status-0 delivery result and existing claim/retry/attempt recording paths.Live Activity and push notification sends switch from a broad
Effect.catchtoEffect.catchTagsfor the threeApnserror types. Tests assert the redacted log payload for a JWT signing failure during signed job processing.Reviewed by Cursor Bugbot for commit 17a510a. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Preserve APNs delivery failure context with structured
ApnsDeliveryTransportErrorloggingApnsDeliveryTransportError, a schema-tagged error class inApnsDeliveries.tsthat capturesdeviceId,kind,sourceJobId,apnsErrorTag,requestStage, andcausefor APNs transport/auth failures.recoverApnsDeliveryTransportError, a helper that logs the error with structured, redacted annotations and maps it to a standardizedApnsDeliveryResultwithok=false.Effect.catchhandlers insendLiveActivityandsendPushNotificationwithEffect.catchTagsscoped toApnsJwtEncodingError,ApnsJwtSigningError, andApnsHttpRequestError.Macroscope summarized 17a510a.