Repository navigation
fix: Warn when offline mode skips the override source, and ignore snapshots after close - #2133
Conversation
…pshots after close When the client is offline and an override source is configured, the source is still not built or started, and the SDK now logs a warning that no overrides are served. The overrides option documents that a configuration error in the source is not reported offline. Closing the client closes the override sink before the source, so a snapshot that a custom source supplies after the client is closed no longer changes the layer or notifies the application.
|
bugbot review |
|
@launchdarkly/js-sdk-common size report |
|
@launchdarkly/js-client-sdk-common size report |
|
@launchdarkly/js-client-sdk size report |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit c07a82b. Configure here.
🤖 I have created a release *beep* *boop* --- <details><summary>akamai-edgeworker-sdk-common: 2.0.46</summary> ## [2.0.46](akamai-edgeworker-sdk-common-v2.0.45...akamai-edgeworker-sdk-common-v2.0.46) (2026-11-02) ### Dependencies * The following workspace dependencies were updated * dependencies * @launchdarkly/js-server-sdk-common bumped from ^2.26.0 to ^2.26.1 </details> <details><summary>akamai-server-base-sdk: 3.0.47</summary> ## [3.0.47](akamai-server-base-sdk-v3.0.46...akamai-server-base-sdk-v3.0.47) (2026-11-02) ### Dependencies * The following workspace dependencies were updated * dependencies * @launchdarkly/akamai-edgeworker-sdk-common bumped from ^2.0.45 to ^2.0.46 </details> <details><summary>akamai-server-edgekv-sdk: 1.4.49</summary> ## [1.4.49](akamai-server-edgekv-sdk-v1.4.48...akamai-server-edgekv-sdk-v1.4.49) (2026-11-02) ### Dependencies * The following workspace dependencies were updated * dependencies * @launchdarkly/akamai-edgeworker-sdk-common bumped from ^2.0.45 to ^2.0.46 * @launchdarkly/js-server-sdk-common bumped from ^2.26.0 to ^2.26.1 </details> <details><summary>client-testing-plugin: 1.0.28</summary> ## [1.0.28](client-testing-plugin-v1.0.27...client-testing-plugin-v1.0.28) (2026-11-02) ### Dependencies * The following workspace dependencies were updated * dependencies * @launchdarkly/js-client-sdk-common bumped from 1.34.1 to 1.35.0 * devDependencies * @launchdarkly/js-client-sdk bumped from 4.13.1 to 4.14.0 * @launchdarkly/react-sdk bumped from 4.1.29 to 4.1.30 * peerDependencies * @launchdarkly/js-client-sdk bumped from ^4.9.1 to ^4.14.0 * @launchdarkly/react-sdk bumped from ^4.1.4 to ^4.1.30 </details> <details><summary>cloudflare-server-sdk: 2.7.48</summary> ## [2.7.48](cloudflare-server-sdk-v2.7.47...cloudflare-server-sdk-v2.7.48) (2026-11-02) ### Dependencies * The following workspace dependencies were updated * dependencies * @launchdarkly/js-server-sdk-common-edge bumped from 2.6.43 to 2.6.44 </details> <details><summary>fastly-server-sdk: 0.2.38</summary> ## [0.2.38](fastly-server-sdk-v0.2.37...fastly-server-sdk-v0.2.38) (2026-11-02) ### Dependencies * The following workspace dependencies were updated * dependencies * @launchdarkly/js-server-sdk-common bumped from 2.26.0 to 2.26.1 </details> <details><summary>jest: 1.0.39</summary> ## [1.0.39](jest-v1.0.38...jest-v1.0.39) (2026-11-02) ### Dependencies * The following workspace dependencies were updated * dependencies * @launchdarkly/react-native-client-sdk bumped from ~10.23.1 to ~10.23.2 </details> <details><summary>js-client-sdk: 4.14.0</summary> ## [4.14.0](js-client-sdk-v4.13.1...js-client-sdk-v4.14.0) (2026-11-02) ### Features * Add a shared WebSocket base to the contract test utils and use it in the browser contract tests ([#2136](#2136)) ([af2f096](af2f096)) * Add an opt-in fetch-based EventSource entry to the browser SDK ([#2033](#2033)) ([7a21f6f](7a21f6f)) ### Dependencies * The following workspace dependencies were updated * dependencies * @launchdarkly/js-client-sdk-common bumped from 1.34.1 to 1.35.0 </details> <details><summary>js-client-sdk-common: 1.35.0</summary> ## [1.35.0](js-client-sdk-common-v1.34.1...js-client-sdk-common-v1.35.0) (2026-11-02) ### Features * Add an opt-in fetch-based EventSource entry to the browser SDK ([#2033](#2033)) ([7a21f6f](7a21f6f)) </details> <details><summary>js-server-sdk-common: 2.26.1</summary> ## [2.26.1](js-server-sdk-common-v2.26.0...js-server-sdk-common-v2.26.1) (2026-11-02) ### Bug Fixes * Treat a repeated override file path in a different case as a repeat on Windows ([#2134](#2134)) ([d331546](d331546)) * Warn when offline mode skips the override source, and ignore snapshots after close ([#2133](#2133)) ([612918c](612918c)) </details> <details><summary>js-server-sdk-common-edge: 2.6.44</summary> ## [2.6.44](js-server-sdk-common-edge-v2.6.43...js-server-sdk-common-edge-v2.6.44) (2026-11-02) ### Dependencies * The following workspace dependencies were updated * dependencies * @launchdarkly/js-server-sdk-common bumped from 2.26.0 to 2.26.1 </details> <details><summary>node-client-sdk: 4.4.1</summary> ## [4.4.1](node-client-sdk-v4.4.0...node-client-sdk-v4.4.1) (2026-11-02) ### Dependencies * The following workspace dependencies were updated * dependencies * @launchdarkly/js-client-sdk-common bumped from 1.34.1 to 1.35.0 </details> <details><summary>node-server-sdk: 9.16.1</summary> ## [9.16.1](node-server-sdk-v9.16.0...node-server-sdk-v9.16.1) (2026-11-02) ### Dependencies * The following workspace dependencies were updated * dependencies * @launchdarkly/js-server-sdk-common bumped from 2.26.0 to 2.26.1 </details> <details><summary>node-server-sdk-dynamodb: 6.4.4</summary> ## [6.4.4](node-server-sdk-dynamodb-v6.4.3...node-server-sdk-dynamodb-v6.4.4) (2026-11-02) ### Dependencies * The following workspace dependencies were updated * devDependencies * @launchdarkly/node-server-sdk bumped from 9.16.0 to 9.16.1 * peerDependencies * @launchdarkly/node-server-sdk bumped from >=9.14.1 to >=9.16.1 </details> <details><summary>node-server-sdk-otel: 1.3.40</summary> ## [1.3.40](node-server-sdk-otel-v1.3.39...node-server-sdk-otel-v1.3.40) (2026-11-02) ### Dependencies * The following workspace dependencies were updated * devDependencies * @launchdarkly/node-server-sdk bumped from 9.16.0 to 9.16.1 * peerDependencies * @launchdarkly/node-server-sdk bumped from >=9.11.3 to >=9.16.1 </details> <details><summary>node-server-sdk-redis: 4.4.4</summary> ## [4.4.4](node-server-sdk-redis-v4.4.3...node-server-sdk-redis-v4.4.4) (2026-11-02) ### Dependencies * The following workspace dependencies were updated * devDependencies * @launchdarkly/node-server-sdk bumped from 9.16.0 to 9.16.1 * peerDependencies * @launchdarkly/node-server-sdk bumped from >=9.14.1 to >=9.16.1 </details> <details><summary>openfeature-cloudflare-server: 1.1.1</summary> ## [1.1.1](openfeature-cloudflare-server-v1.1.0...openfeature-cloudflare-server-v1.1.1) (2026-11-02) ### Dependencies * The following workspace dependencies were updated * devDependencies * @launchdarkly/cloudflare-server-sdk bumped from 2.7.47 to 2.7.48 * peerDependencies * @launchdarkly/cloudflare-server-sdk bumped from ^2.7.0 to ^2.7.48 </details> <details><summary>openfeature-node-server: 2.1.4</summary> ## [2.1.4](openfeature-node-server-v2.1.3...openfeature-node-server-v2.1.4) (2026-11-02) ### Dependencies * The following workspace dependencies were updated * devDependencies * @launchdarkly/node-server-sdk bumped from 9.16.0 to 9.16.1 * peerDependencies * @launchdarkly/node-server-sdk bumped from ^9.0.0 to ^9.16.1 </details> <details><summary>react-native-client-sdk: 10.23.2</summary> ## [10.23.2](react-native-client-sdk-v10.23.1...react-native-client-sdk-v10.23.2) (2026-11-02) ### Dependencies * The following workspace dependencies were updated * dependencies * @launchdarkly/js-client-sdk-common bumped from 1.34.1 to 1.35.0 </details> <details><summary>react-sdk: 4.1.30</summary> ## [4.1.30](react-sdk-v4.1.29...react-sdk-v4.1.30) (2026-11-02) ### Dependencies * The following workspace dependencies were updated * dependencies * @launchdarkly/js-client-sdk bumped from ^4.13.1 to ^4.14.0 * @launchdarkly/js-server-sdk-common bumped from ^2.26.0 to ^2.26.1 </details> <details><summary>server-sdk-ai: 2.0.17</summary> ## [2.0.17](server-sdk-ai-v2.0.16...server-sdk-ai-v2.0.17) (2026-11-02) ### Dependencies * The following workspace dependencies were updated * devDependencies * @launchdarkly/js-server-sdk-common bumped from 2.26.0 to 2.26.1 * peerDependencies * @launchdarkly/js-server-sdk-common bumped from ^2.0.0 to ^2.26.1 </details> <details><summary>server-sdk-ai-langchain: 0.8.28</summary> ## [0.8.28](server-sdk-ai-langchain-v0.8.27...server-sdk-ai-langchain-v0.8.28) (2026-11-02) ### Dependencies * The following workspace dependencies were updated * devDependencies * @launchdarkly/server-sdk-ai bumped from ^2.0.16 to ^2.0.17 * peerDependencies * @launchdarkly/server-sdk-ai bumped from ^1.1.1 || ^2.0.0 to ^2.0.17 </details> <details><summary>server-sdk-ai-openai: 0.7.28</summary> ## [0.7.28](server-sdk-ai-openai-v0.7.27...server-sdk-ai-openai-v0.7.28) (2026-11-02) ### Dependencies * The following workspace dependencies were updated * devDependencies * @launchdarkly/js-server-sdk-common bumped from 2.26.0 to 2.26.1 * @launchdarkly/server-sdk-ai bumped from ^2.0.16 to ^2.0.17 * peerDependencies * @launchdarkly/server-sdk-ai bumped from ^1.1.1 || ^2.0.0 to ^2.0.17 </details> <details><summary>server-sdk-ai-vercel: 0.7.28</summary> ## [0.7.28](server-sdk-ai-vercel-v0.7.27...server-sdk-ai-vercel-v0.7.28) (2026-11-02) ### Dependencies * The following workspace dependencies were updated * devDependencies * @launchdarkly/server-sdk-ai bumped from ^2.0.16 to ^2.0.17 * peerDependencies * @launchdarkly/server-sdk-ai bumped from ^1.1.1 || ^2.0.0 to ^2.0.17 </details> <details><summary>shopify-oxygen-sdk: 0.2.3</summary> ## [0.2.3](shopify-oxygen-sdk-v0.2.2...shopify-oxygen-sdk-v0.2.3) (2026-11-02) ### Dependencies * The following workspace dependencies were updated * dependencies * @launchdarkly/js-server-sdk-common bumped from 2.26.0 to 2.26.1 </details> <details><summary>vercel-server-sdk: 1.3.71</summary> ## [1.3.71](vercel-server-sdk-v1.3.70...vercel-server-sdk-v1.3.71) (2026-11-02) ### Dependencies * The following workspace dependencies were updated * dependencies * @launchdarkly/js-server-sdk-common-edge bumped from 2.6.43 to 2.6.44 </details> <details><summary>vue-client-sdk: 3.0.9</summary> ## [3.0.9](vue-client-sdk-v3.0.8...vue-client-sdk-v3.0.9) (2026-11-02) ### Dependencies * The following workspace dependencies were updated * dependencies * @launchdarkly/js-client-sdk bumped from 4.13.1 to 4.14.0 </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Overview** > Release Please **version bump** across the monorepo (manifest, changelogs, `package.json`, and `x-release-please-version` strings). No new application logic in this diff—the release carries work already merged on `main`. > > **Client (1.35.0 / 4.14.0):** `@launchdarkly/js-client-sdk-common` adds an **opt-in fetch-based EventSource** path; the browser SDK **4.14.0** picks that up and also notes shared WebSocket contract-test infrastructure. > > **Server common (2.26.1):** `@launchdarkly/js-server-sdk-common` fixes **override file deduplication on Windows** (same path, different casing) and improves **offline + override** behavior (warn when overrides are skipped; ignore snapshots after close). > > **Cascade:** Node server/client, React/Vue/React Native, edge SDKs (Cloudflare, Vercel, Akamai, Fastly, Shopify Oxygen), AI SDK + providers, OpenFeature wrappers, stores, OTEL, and tooling get **patch/minor bumps** that realign workspace dependencies on those commons releases. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit d620eaf. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
<!-- TERMAG_PR_BODY_BEGIN --> ## Summary When the client is offline, the data system does not start a configured override source, and that stays so. Nothing said so before: an application running offline with overrides saw default values and no explanation. The SDK now logs a warning when it creates the data system: `Offline mode is enabled; the override source is not started and no overrides are served`. The `Overrides` builder method documents the offline behavior. In Go the data system configuration is built whether or not the client is offline, so the source is built, and an invalid source configuration still fails client creation offline; the documentation says so, and a test pins it. This follows the review of the same code in the .NET port (launchdarkly/dotnet-core#364). The Node change is launchdarkly/js-core#2133. ## Tests - `TestOverrideSourceIsNotStartedAndAWarningIsLoggedWhenOffline`: the source is not started, the warning is logged once, and the overridden flag serves the default. It fails without the change and fails again with it reverted. - `TestNoOverrideWarningIsLoggedWhenOfflineWithoutAnOverrideSource`: offline without a source logs no override warning. - `TestFileOverrideSourceConfigurationErrorIsReportedWhenOffline`: a file source without paths still fails client creation offline. `go test -race ./...` passes and `make lint` reports no issues. <!-- TERMAG_PR_BODY_END --> <!-- termag: box=i-0575d1c54853058d7 project=go-server-sdk --> <sub>Opened from termag</sub> [SDK-3419](https://launchdarkly.atlassian.net/browse/SDK-3419) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Overview** > **Offline clients with a configured override source no longer fail silently.** When the data system is disabled for offline mode, the SDK still does not start the override source or serve overrides, but it now logs a warning at construction: `Offline mode is enabled; the override source is not started and no overrides are served`. > > The `DataSystemConfigurationBuilder.Overrides` docs describe this behavior and note that invalid override configuration is still validated at client creation (the source is built even when offline). > > New tests cover the warning when an override source is present, no warning when offline without one, and file-source config errors (e.g. missing paths) still failing `MakeCustomClient` while offline. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit eb656a6. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> [SDK-3419]: https://launchdarkly.atlassian.net/browse/SDK-3419?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Summary
Two follow-ups from the review of the same code in the .NET port (launchdarkly/dotnet-core#364).
Offline mode. When the client is offline, a configured override source is not built or started, and that stays so. Nothing said so before: an application running offline with overrides saw default values and no explanation, and a configuration error in the source went unreported. The SDK now logs a warning once, at construction:
Offline mode is enabled; the override source is not started and no overrides are served. Theoverridesoption documents that the source is not built or started offline, that no overrides are served, and that a configuration error in the source is not reported then.Snapshots after close.
close()closed the override source, but the sink kept accepting snapshots, so a custom source that supplied one after the client was closed still replaced the layer and sent flag change events to the application. The client now closes the sink before the source. A closed sink ignores a snapshot (logged at debug level) and keeps the layer as it is, so closing sends no change events of its own. The SDK's file-based source stops supplying snapshots when it is closed, so this only matters for a custom source.Tests
Three tests in
LDClientImpl.overrides.test.ts: offline mode logs the warning and never calls the source factory; offline mode without a source logs no override warning; and a snapshot supplied through the sink afterclose()produces no change event and no override. The first and third fail without the change, and each fails again with its fix reverted. The sdk-server suite passes (1562 passed, 7 skipped), and lint and formatting are clean.Opened from termag
SDK-3419
Note
Overview
Offline + overrides. When
offlineis enabled butdataSystem.overridesis set, the SDK still does not build or start the override source (unchanged). It now logs a one-time construction warning: Offline mode is enabled; the override source is not started and no overrides are served, andLDDataSystemOptionsdocuments that behavior. Offline clients without an override source do not get that warning.Shutdown.
OverrideSinkgains aclose()that stops accepting snapshots; latesetOverridescalls are ignored (debug log) and do not update the layer or fire flag-change listeners.LDClientImpl.close()closes the sink before the override source so custom sources that keep pushing after close cannot mutate state post-shutdown.Three tests cover the offline warning, absence of spurious warnings, and post-close snapshot handling.
Reviewed by Cursor Bugbot for commit c07a82b. Bugbot is set up for automated code reviews on this repo. Configure here.