Skip to content

[SDK-715] Mark network failures on API responses - #1114

Open
franco-zalamena-iterable wants to merge 1 commit into
feature/SDK-715-b-retry-injectionfrom
feature/SDK-715-c1-network-failure
Open

franco-zalamena-iterable wants to merge 1 commit into
feature/SDK-715-b-retry-injectionfrom
feature/SDK-715-c1-network-failure

Conversation

@franco-zalamena-iterable

@franco-zalamena-iterable franco-zalamena-iterable commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

📝 Summary

Adds a network failure marker to API responses and classifies which I/O errors count as network failures. Only tests read it for now.

🎟️ Jira Ticket: SDK-715

Epic: SDK-454

Stack, in order: #1111 (SDK-714), #1112, #1113, #1114, #1115. This is #1114.

📖 Description

Today every client side failure is reported as code 0, so the retry policy can't tell a timeout from a bad URL. This PR adds a networkFailure flag on IterableApiResponse and sets it when the request fails with a network error.

IterableNetworkRetryClassifier.isNetworkFailure treats timeouts, DNS failures, connection and socket errors and EOF as network failures. It also follows the cause chain, since on devices a dropped connection often comes as a plain IOException caused by an EOF or socket error. That covers TLS errors caused by a socket reset too. Other I/O errors, other TLS errors and bad URLs stay as plain code 0 failures.

Nothing in the request flow reads the flag yet, the legacy retry loop ignores it and a test pins that. It starts being used in #1115.

🧪 How to test?

./gradlew :iterableapi:testDebugUnitTest gives 846 tests, 21 skipped and 0 failures. Checkstyle, lint and the androidTest compile are green. The IterableRequestTaskTest cases use real refused, dropped and timed out connections, plus a test URL handler for the dropped case.

🧾 Changelog

No customer facing changes

🤖 Generated with Claude Code

An IOException from the request is marked as a network failure when it is
a timeout, DNS failure, socket error or EOF, or has an EOF or socket
error in its cause chain, which is how devices report a dropped
connection, including a TLS handshake closed by the server. Other I/O,
TLS and invalid-URL failures are not marked. Only the network retry
policy will read the marker; the legacy retry loop ignores it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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