Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDK crashing when switching User while observing channels #5260

Open
sebastianmarschall opened this issue May 14, 2024 · 0 comments
Open

SDK crashing when switching User while observing channels #5260

sebastianmarschall opened this issue May 14, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@sebastianmarschall
Copy link

Describe the bug
When calling client.switchUser while observing channels with client.queryChannelsAsState the SDK occasionally crashes with

java.lang.IllegalStateException: Plugin 'io.getstream.chat.android.state.plugin.internal.StatePlugin' was not found. Did you init it within ChatClient?
at io.getstream.chat.android.state.extensions.ChatClientExtensions.getState(ChatClient.kt:521)

Client is initialized with StatePlugin:

private val offlinePluginFactory = StreamOfflinePluginFactory(appContext = context.applicationContext)
private val statePluginFactory = StreamStatePluginFactory(config = StatePluginConfig(), appContext = context.applicationContext)

private val client = ChatClient.Builder(apiKey, context.applicationContext)
        .withPlugins(offlinePluginFactory, statePluginFactory)
        .notifications(notificationConfig, notificationHandler)
        .logLevel(if (BuildConfig.DEBUG) ChatLogLevel.ALL else ChatLogLevel.NOTHING)
        .build()

SDK version

  • 6.3.2

To Reproduce
Steps to reproduce the behavior:

  1. Create app that upon a button click switches between two users.
  2. Click that button vigorously
  3. Observe crash

Expected behavior
No crash

Device:

  • Emulator & real Pixel 8
@sebastianmarschall sebastianmarschall added the bug Something isn't working label May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant