customerio / customerio-android

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

Crash with IllegalArgumentException #466

Closed remi-ollivier closed 2 weeks ago

remi-ollivier commented 2 weeks ago

SDK version: 4.3.0

Environment: Production

Are logs available?

Fatal Exception: java.lang.IllegalArgumentException:
       at android.os.Parcel.nativeAppendFrom(Parcel.java)
       at android.os.Parcel.appendFrom(Parcel.java:466)
       at android.os.BaseBundle.<init>(BaseBundle.java:164)
       at android.os.Bundle.<init>(Bundle.java:106)
       at android.content.Intent.getExtras(Intent.java:7050)
       at io.customer.messagingpush.ModuleMessagingPushFCM$subscribeToLifecycleEvents$1$2.emit(ModuleMessagingPushFCM.kt:38)
       at io.customer.messagingpush.ModuleMessagingPushFCM$subscribeToLifecycleEvents$1$2.emit(ModuleMessagingPushFCM.kt:35)
       at io.customer.messagingpush.ModuleMessagingPushFCM$subscribeToLifecycleEvents$1$invokeSuspend$$inlined$filter$1$2.emit(Emitters.kt:223)
       at kotlinx.coroutines.flow.SharedFlowImpl.collect$suspendImpl(SharedFlow.kt:397)
       at kotlinx.coroutines.flow.SharedFlowImpl$collect$1.invokeSuspend(SharedFlow.kt:13)
       at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
       at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:101)
       at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.java:589)
       at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:832)
       at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:720)
       at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:707)

Describe the bug It crashes for users on production, we couldn't replicate during dev More info:

To Reproduce We were not able to reproduce

Expected behavior No crash

Screenshots

Additional context

mrehan27 commented 2 weeks ago

@remi-ollivier Sorry for the inconvenience, and thank you for reaching out with the details. From stack trace, it looks like the crash is occurring in native Android OS code while accessing intent.extras, which seems to be an issue observed in earlier Android versions. Since this is happening in the OS code, our options are limited. But I think we can reduce this by surrounding it with try-catch in our next release.

We'll include this fix and roll it out in the upcoming release. If you have any additional details that might help us address this better, please feel free to share. Thank you again for bringing this to our attention. Have a great day!