Skip to content

fix: Warn when offline mode skips the override source - #493

Merged
kinyoklion merged 2 commits into
v7from
rlamb/overrides-go-offline-warning
Nov 2, 2026
Merged

kinyoklion merged 2 commits into
v7from
rlamb/overrides-go-offline-warning

Conversation

@kinyoklion

@kinyoklion kinyoklion commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

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.

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.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.

Reviewed by Cursor Bugbot for commit eb656a6. Bugbot is set up for automated code reviews on this repo. Configure here.

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.
@kinyoklion

Copy link
Copy Markdown
Member Author

bugbot review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ 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
kinyoklion marked this pull request as ready for review October 30, 2026 23:54
@kinyoklion
kinyoklion requested a review from a team as a code owner October 30, 2026 23:54
…ine-warning

Co-Authored-By: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com>

# Conflicts:
#	ldclient_overrides_test.go
@kinyoklion
kinyoklion merged commit 69bbe61 into v7 Nov 2, 2026
30 checks passed
@kinyoklion
kinyoklion deleted the rlamb/overrides-go-offline-warning branch November 2, 2026 23:54
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.

2 participants