Repository navigation
fix(events): retry TLS and certificate failures on the normal backoff - #445
Open
abelonogov-ld wants to merge 1 commit into
Open
abelonogov-ld wants to merge 1 commit into
abelonogov-ld wants to merge 1 commit into
Conversation
The revised RETRY spec dropped TLS and certificate failures from the unexpected class, and the durability spec (section 9) lists them as normal. The analytics sender still sent SSLHandshakeException and SSLPeerUnverifiedException to the extended backoff (512 s to an hour), unlike the iOS SDK. A post with no response is now always normal. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Risk: medium. Not approved: Rule 2 (Allowed PR authors) — this author is not on the approved-author list, so this automation cannot approve. Cursor Bugbot completed with no findings; human review is needed and no reviewers were assigned.
Sent by Cursor Approval Agent: SDK - Pull Request Router and Approver
This branch has not been deployed
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.


Follow-up from the iOS tier 3 review (ios-client-sdk#538 thread).
The revised RETRY spec removed TLS and certificate failures from the
unexpectedclass, and the durability spec (section 9) lists them asnormal. iOS already follows that. Android'sAnalyticsEventSenderstill classedSSLHandshakeExceptionandSSLPeerUnverifiedExceptionasunexpected, so during a certificate incident Android backed off for 512 seconds to an hour where iOS keeps retrying on the normal ceiling.normal, TLS and certificate failures included.unexpecteddocs onAnalyticsEventSender.ResultandDeliveryRetryState.recordFailureno longer mention TLS.AnalyticsEventSenderTest.certificateFailureTakesTheNormalBackoffposts to an HTTPS server with a self-signed certificate. It fails with the old classification (the post fails withSSLHandshakeException) and passes with this change.All 1276 unit tests pass locally.
Note
Overview
Aligns Android analytics event delivery with the updated retry spec and iOS: TLS and certificate failures are no longer treated as
unexpected, so they follow the normal exponential backoff (capped at the flush interval) instead of the long “unexpected” path (up to ~an hour).AnalyticsEventSendernow marks anyIOExceptionon post—including handshake/certificate errors—asunexpected = false, and the related Javadoc onResultandDeliveryRetryState.recordFailuredrops TLS from theunexpecteddefinition. A new unit test posts to a self-signed HTTPS endpoint and assertsunexpectedis false.Reviewed by Cursor Bugbot for commit 3d2ba15. Bugbot is set up for automated code reviews on this repo. Configure here.