customerio / customerio-android

This is the official Customer.io SDK for Android.
MIT License
12 stars 9 forks source link

Crash on messaginginapp #426

Closed esdrasdl closed 3 days ago

esdrasdl commented 3 weeks ago

SDK version: 4.1.0

Environment: Production

Are logs available? Nope, no crashes in development

Describe the bug Crash for a few users. This is one of our top 5 crashes.

To Reproduce Unfortunately, I couldn't provide a step to step to reproduce it.

Here is the stacktrace:

          Fatal Exception: java.lang.NullPointerException: Attempt to write to field 'java.util.LinkedHashMap$LinkedEntry java.util.LinkedHashMap$LinkedEntry.prv' on a null object reference
       at java.util.LinkedHashMap.postRemove(LinkedHashMap.java:292)
       at java.util.HashMap.remove(HashMap.java:630)
       at java.util.HashSet.remove(HashSet.java:173)
       at io.customer.messaginginapp.gist.presentation.GistSdk.onActivityPaused$messaginginapp_release(GistSdk.kt:74)
       at io.customer.messaginginapp.gist.presentation.GistSdk$subscribeToLifecycleEvents$1$2.emit(GistSdk.kt:136)
       at io.customer.messaginginapp.gist.presentation.GistSdk$subscribeToLifecycleEvents$1$2.emit(GistSdk.kt:132)
       at io.customer.messaginginapp.gist.presentation.GistSdk$subscribeToLifecycleEvents$1$invokeSuspend$$inlined$filter$1$2.emit(Emitters.kt:223)
       at kotlinx.coroutines.flow.SharedFlowImpl.collect$suspendImpl(SharedFlow.kt:392)
       at kotlinx.coroutines.flow.SharedFlowImpl$collect$1.invokeSuspend(SharedFlow.kt)
       at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
       at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
       at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.java:584)
       at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:811)
       at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:715)
       at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:702)

Expected behavior No crashes

Screenshots

Captura de Tela 2024-08-23 às 16 19 28 Captura de Tela 2024-08-23 às 16 19 38
mrehan27 commented 2 weeks ago

Hi @esdrasdl. Thanks for reaching out and sharing the details. Sorry about the inconvenience this may have caused. We haven't seen this before, but the logs provided are helpful enough to identify the root cause.

If you notice any patterns, specific activities causing this, or any other details that you think could be helpful, please share them with us. In the meantime, we'll look into it and work on a fix soon. In case you find any clues that can help us reproduce this issue, do let us know, as it will help us validate the fix more effectively.

Have a great day. We'll get back to you soon.

Shahroz16 commented 3 days ago

@esdrasdl 4.2.0 is also out with the latest updates to in-app is out and it should fix this for you. Closing the ticket, please let us know if you still experience it.