Skip to content

feat!: Report every connection failure and add an option to not reconnect - #348

Draft
jsonbailey wants to merge 1 commit into
jb/sdk-3321/status-latchfrom
jb/sdk-3322/sse-report-failures
Draft

jsonbailey wants to merge 1 commit into
jb/sdk-3321/status-latchfrom
jb/sdk-3322/sse-report-failures

Conversation

@jsonbailey

@jsonbailey jsonbailey commented Oct 16, 2026 •

Copy link
Copy Markdown

Summary

Stacked on #348. Adds the retry groundwork to launchdarkly_dart_common, so that data sources now (and the event processor later) share one implementation.

  • RetryState: exponential backoff with jitter, a normal regime and a sticky extended regime for unexpected failures, a reset after healthy operation (a duration for streaming, 2 successes for polling), and a floor at the poll interval.
  • FailureKind, plus classifyHttpStatus and credentialHint in network/utils.dart, next to isHttpGloballyRecoverable.
  • Nothing uses them yet. common_client and the Flutter SDK do not re-export them.

@jsonbailey
jsonbailey added this pull request to stack #353 October 16, 2026 06:33
EventSourceLogger? logger,
Uri Function()? uriProvider}) {
Uri Function()? uriProvider,
bool autoReconnect = true}) {

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Cross-SDK note: iOS stops its SSE library by returning .shutdown from connectionErrorHandler, and Android returns ConnectionErrorHandler.Action.SHUTDOWN. The Dart client had no way to control its retry, and a 0 s retry would race with the owner's close, so this adds an explicit option.

StateIdle.run(svo, errorCause: error);
return;
}
svo.reportError(error);

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

In default mode the client now also reports routine failures (server close, timeout, transport, content type). FDv2 streaming maps them to interrupted, which matches Android FDv2 (FDv2StreamingSynchronizer.handleError). Intermediate PRs in this stack fail the v2 streaming contract tests, because main's FDv1 streaming code meets this library. #352 replaces that code.

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