Skip to content

fix(events): retry TLS and certificate failures on the normal backoff - #445

Open
abelonogov-ld wants to merge 1 commit into
mainfrom
andrey/tls-normal-backoff
Open

abelonogov-ld wants to merge 1 commit into
mainfrom
andrey/tls-normal-backoff

Conversation

@abelonogov-ld

@abelonogov-ld abelonogov-ld commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Follow-up from the iOS tier 3 review (ios-client-sdk#538 thread).

The revised RETRY spec removed TLS and certificate failures from the unexpected class, and the durability spec (section 9) lists them as normal. iOS already follows that. Android's AnalyticsEventSender still classed SSLHandshakeException and SSLPeerUnverifiedException as unexpected, so during a certificate incident Android backed off for 512 seconds to an hour where iOS keeps retrying on the normal ceiling.

  • A post that gets no response is now always normal, TLS and certificate failures included.
  • The unexpected docs on AnalyticsEventSender.Result and DeliveryRetryState.recordFailure no longer mention TLS.
  • New AnalyticsEventSenderTest.certificateFailureTakesTheNormalBackoff posts to an HTTPS server with a self-signed certificate. It fails with the old classification (the post fails with SSLHandshakeException) 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).

AnalyticsEventSender now marks any IOException on post—including handshake/certificate errors—as unexpected = false, and the related Javadoc on Result and DeliveryRetryState.recordFailure drops TLS from the unexpected definition. A new unit test posts to a self-signed HTTPS endpoint and asserts unexpected is false.

Reviewed by Cursor Bugbot for commit 3d2ba15. Bugbot is set up for automated code reviews on this repo. Configure here.

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>
@abelonogov-ld
abelonogov-ld requested a review from a team as a code owner November 24, 2026 01:33

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Open in Web View Automation 

Sent by Cursor Approval Agent: SDK - Pull Request Router and Approver

This branch has not been deployed

No deployments
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