Document client assignment request reliability - #39560
Conversation
Document zero-default assignment timeout and retry controls for supported client SDKs, including composable transport examples. Defer React Native until released native dependencies are available. Environment: Datadog workspace
bb55615 to
a1b96ad
Compare
|
/review |
There was a problem hiding this comment.
🤖 Automated review by Claude. AI-generated; verify before acting.
Content is accurate and complete. Two blocker-adjacent findings on the new snippets/alert copy, plus one consistency nit.
Reviewed 030aba59578b1c918e736d9f81fb2957934d7f5b — workflow run
| For lower-level transport control, compose an assignment-only HTTP client: | ||
|
|
||
| {{< code-block lang="dart" >}} | ||
| import 'package:http/http.dart' as http; |
There was a problem hiding this comment.
Issue: This snippet uses withAssignmentRequestTimeout and withAssignmentRequestRetry (lines 321-322) but only imports package:http/http.dart. Copy-pasting will fail to compile because the helpers aren't in scope. Add the package they ship in (likely something like package:datadog_flags/datadog_flags.dart) so the example is complete, matching how the JS example on javascript.md imports withTimeout and withRetry alongside DatadogProvider.
|
|
||
| Choose the SDK that matches where the flag is evaluated and initialize the Datadog Feature Flags provider. | ||
|
|
||
| <div class="alert alert-warning">Client SDKs do not add a flag assignment request timeout or retry by default, so the underlying platform transport remains authoritative. Configure a bounded timeout of at most 1,500 milliseconds for predictable initialization, and opt in to retries only when appropriate. The browser example below applies a 1,500-millisecond timeout with no retries. The supported SDK guides describe their timeout options and composable transport APIs.</div> |
There was a problem hiding this comment.
Suggestion: A couple of small clarity issues in this alert:
- "The supported SDK guides describe their timeout options and composable transport APIs" doesn't link to those guides — from the getting-started page a reader has no direct path to them.
- "The browser example below" is a bit misleading because the example sits inside tabs; only readers who land on the JavaScript tab see the timeout applied. Consider either applying the same pattern in each tab or rephrasing so the guidance stands on its own regardless of which tab is active.
- "Opt in to retries only when appropriate" gives the reader no criteria — consider dropping it or briefly stating when retries help (for example, tolerating transient 5xx during initialization).
| }); | ||
| {{< /code-block >}} | ||
|
|
||
| In this example, each attempt has a 1.5-second timeout and `2` allows two retries after the initial request. The timeout includes downloading the response body. Set the timeout or retry count to `0` to disable that behavior; retry counts from `0` to `10` are accepted. Retries cover network errors, timeouts, HTTP 408, and HTTP 5xx responses; caller cancellation and HTTP 429 responses are not retried. `flagConfigurationFetch` applies only to flag configuration requests; it does not affect exposure, aggregated flag evaluation, or RUM telemetry requests. |
There was a problem hiding this comment.
Style: This is a single dense paragraph that mixes timeout semantics, retry semantics, accepted ranges, retry conditions, and scope. Every other SDK page in this PR (Android, iOS, Flutter, Unity) documents the same information as a definition list (one term per option, plus a short scoped-to alert). Consider mirroring that structure here for consistency and scannability — for example, break out withTimeout and withRetry as definition terms and move the "applies only to flag configuration requests" sentence into its own info callout.
aarsilv
left a comment
There was a problem hiding this comment.
Nice! Thanks for getting this out so fast. Approving assuming the code issues caught by GitHub fixed up.
| // 3. Enable Feature Flags with a bounded assignment request timeout | ||
| Flags.enable( | ||
| FlagsConfiguration.Builder() | ||
| .assignmentRequestTimeout(1_500L) |
| import com.datadog.android.flags.FlagsConfiguration | ||
|
|
||
| val flagsConfiguration = FlagsConfiguration.Builder() | ||
| .assignmentRequestTimeout(1_500L) |
| )..addPlugin( | ||
| const DatadogFlagsPluginConfiguration( | ||
| flagsConfiguration: DatadogFlagsConfiguration( | ||
| assignmentRequestTimeout: Duration(milliseconds: 1500), |
|
|
||
| Flags.enable() | ||
| var flagsConfiguration = Flags.Configuration() | ||
| flagsConfiguration.assignmentRequestTimeout = 1.5 |
There was a problem hiding this comment.
Ideally the variable would have units, especially since not MS, (e.g., assignmentRequestTimeoutSec) but that is outside the scope of this PR
| {{< /code-block >}} | ||
|
|
||
| `assignmentRequestTimeout` | ||
| : Timeout in seconds for each flag assignment request, including the complete response-body download. The SDK does not add a timeout by default. Set a positive value to enable the timeout; `0` leaves it disabled. |
There was a problem hiding this comment.
And we cover "seconds" here 👌
| }); | ||
| {{< /code-block >}} | ||
|
|
||
| In this example, each attempt has a 1.5-second timeout and `2` allows two retries after the initial request. The timeout includes downloading the response body. Set the timeout or retry count to `0` to disable that behavior; retry counts from `0` to `10` are accepted. Retries cover network errors, timeouts, HTTP 408, and HTTP 5xx responses; caller cancellation and HTTP 429 responses are not retried. `flagConfigurationFetch` applies only to flag configuration requests; it does not affect exposure, aggregated flag evaluation, or RUM telemetry requests. |
|
|
||
| DdFlags.Enable(); | ||
| DdFlags.Enable(new FlagsConfiguration( | ||
| assignmentRequestTimeoutSeconds: 1, |
Motivation
Client applications need a visible way to protect assignment initialization from stalled requests without changing default SDK behavior. The primary setup path should show a bounded timeout, while the platform guides retain the complete timeout, retry, and lower-level transport building blocks.
This PR consolidates the cross-client documentation and supersedes #38869, #38870, #38871, #38872, and #38873.
Changes
flagConfigurationFetchwithwithRetry(withTimeout(globalThis.fetch, timeoutMs), retries)in advanced configuration.AssignmentRequestFetch, AndroidCall.Factory, Darthttp.Client, and UnityIAssignmentRequestTransport.Decisions
0disables the SDK timeout and retry policies, producing one initial request while underlying platform/custom transport limits remain authoritative.Validation
git diff --checkpasses.Makefile.configare absent.Dependencies
@datadog/openfeature-browser@1.4.0is published to npm aslatest.