Skip to content

LaunchDarkly .NET SDK using MAUI artifacts on non-MAUI backend service application #338

Description

@BorderKeeper

Describe the bug
We are an non-MAUI app (part system service backend, part WPF UI frontend.) After we migrated from our 4.0.0 version of LD to 5.9.0 we noticed that the SDK stopped recognizing that the internet came back if you started the app without internet and then turned it back on. We have made a simple demonstrator console app and could reproduce this effect.

To reproduce

  1. Plain .NET 9 console
  2. Reference LaunchDarkly.ClientSdk 5.9.x.
  3. Turn the WiFi off.
  4. LdClient.Init(config, context, 10s). Init returns Initialized=false, DataSourceStatus=NetworkUnavailable, NetworkAccess=Local.
  5. Turn the network back on.

Observed behaviour
polled NetworkAccess flips to Internet, but ConnectivityChanged never fires; DataSourceStatus stays NetworkUnavailable; evaluations keep returning the fallback. Never recovers.

Expected behavior
(similar to 4.0.0): reconnects, DataSourceStatus -> Valid, real value returned.

Logs
4.0.0 and 5.9.6 run.txt

SDK version
5.9.0 and 5.9.6 (but all that use MAUI libraries will be affected)

Language version, developer tools
.NET 9.0.

OS/platform
Windows 11

Additional context (code example used)

var config = Configuration.Builder(mobileKey, ConfigurationBuilder.AutoEnvAttributes.Disabled)
    .Persistence(Components.NoPersistence).Build();
var client = LdClient.Init(config, ctx, TimeSpan.FromSeconds(10));   // network is OFF here
client.DataSourceStatusProvider.StatusChanged += (s, st) => Log($"status -> {st.State}");
client.FlagTracker.FlagValueChanged += (s, e) => Log($"FlagValueChanged {e.Key} -> {e.NewValue}");
// then poll every 2s: client.DataSourceStatusProvider.Status.State and client.BoolVariation(flag,false)
// turn network back ON mid-run and observe.

I would be very appreciative if the MAUI requirement was dropped from this SDK. Most .NET applications relying on Launch Darkly are not running MAUI, or even any UI layer at all and are unable to use Launch Darkly at all due to this. Also apologizes I marked it as package:sdk/server but you don't have a client package option available in the list.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions