Skip to content

ConnectionInformation doesn't get updated after identifying to a different context #226

@anawu2006

Description

@anawu2006

Is this a support request?
No

Describe the bug
In SDK 3.6.0, LDClient.get().connectionInformation will get updated with a new lastSuccessfulConnection value after identifying to a different user, but not in 5.0.0.

To reproduce

  1. init LDClient with ldContext1 and register a LDStatusListener
    LDClient.init(context, config, ldContext1, 3)
    LDClient.get().registerStatusListener(statusListener)
    
  2. switch to ldContext2:
    LDClient.get().identify(ldContext2)
    
  3. LDClient.get().connectionInformation doesn't get updated and LDStatusListener.onConnectionModeChanged doesn't get triggered.

Expected behavior
LDClient.get().connectionInformation should be updated with a new lastSuccessfulConnection value and LDStatusListener.onConnectionModeChanged` should be triggered.

Logs
None.

SDK version
5.0.0

Language version, developer tools
Android Kotlin, API 34

OS/platform
Android 13

Additional context
I have checked the source code of ConnectivityManager.setStatusand noticed that LastSuccessfulConnection value won't be updated if the ConnectionMode doesn't change. I think the connection information should be updated in this case given the LDContext changed. But feel free to close this out if you don't think so.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions