Repository navigation
fix: Warn when offline mode skips the override source - #493
Merged
Merged
Conversation
When the client is offline and an override source is configured, the source is still built but not started, and the SDK now logs a warning that no overrides are served. The Overrides builder documents it, and that a configuration error in the source is still reported when the client is created.
Member
Author
|
bugbot review |
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 3e06305. Configure here.
kinyoklion
marked this pull request as ready for review
October 30, 2026 23:54
…ine-warning Co-Authored-By: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com> # Conflicts: # ldclient_overrides_test.go
joker23
approved these changes
Nov 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Overridesbuilder 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 andmake lintreports no issues.Opened from termag
SDK-3419
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.Overridesdocs 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
MakeCustomClientwhile offline.Reviewed by Cursor Bugbot for commit eb656a6. Bugbot is set up for automated code reviews on this repo. Configure here.