Skip to content

Commit 142da36

Browse files
authored
fix: Ensure FDv2 waits for network results instead of cached results. (#1397)
<!-- CURSOR_SUMMARY --> > [!NOTE] > **Low Risk** > Single-path behavior change in browser identify options; aligns with documented browser-only network semantics and does not touch auth or persistence. > > **Overview** > The browser client’s **`identifyResult`** path now always passes **`waitForNetworkResults: true`** into the shared identify flow so FDv2 **identify** completes on fresh network flag data instead of settling on cached results. > > The identify options object is typed as **`LDBaseIdentifyOptions`**, and when **`sheddable`** is already provided the code copies options with a spread (same as the default branch) before setting **`waitForNetworkResults`**. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 4f086c7. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent 2f73d8c commit 142da36

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

packages/sdk/browser/src/BrowserClient.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,10 +235,13 @@ class BrowserClientImpl extends LDClientImpl {
235235
context: LDContext,
236236
identifyOptions?: LDIdentifyOptions,
237237
): Promise<LDIdentifyResult> {
238-
const options =
238+
const options: LDBaseIdentifyOptions =
239239
identifyOptions?.sheddable === undefined
240240
? { ...identifyOptions, sheddable: true }
241-
: identifyOptions;
241+
: { ...identifyOptions };
242+
// The browser only supports waiting for network results.
243+
options.waitForNetworkResults = true;
244+
242245
const res = await super.identifyResult(context, options);
243246
// Ensure that we do not start the goal manager if start() is not called.
244247
if (this.startPromise) {

0 commit comments

Comments
 (0)