OneSignal / OneSignal-Cordova-SDK

OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your Ionic, PhoneGap CLI, PhoneGap Build, Cordova, or Sencha Touch app with OneSignal. Supports Android, iOS, and Amazon's Fire OS platforms. https://onesignal.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug]: java.util.ConcurrentModificationException

christiaan opened this issue · comments

What happened?

The app completely crashes

Steps to reproduce?

We migrated from version 3.x to 5.x

Replaced `setAppId` with `initialize`.
Replaced `setNotificationOpenedHandler` with `click` event listener on Notifications.
Replaced `addSubscriptionObserver` with `change` event listener on User.pushSubscription.
And at the end added the requestPermission call.

What did you expect to happen?

No crash

OneSignal Cordova SDK version

5.0.4

Which platform(s) are affected?

  • iOS
  • Android 13 and higher

Relevant log output

Exception java.util.ConcurrentModificationException:
  at java.util.ArrayList$Itr.checkForComodification (ArrayList.java:1029)
  at java.util.ArrayList$Itr.next (ArrayList.java:982)
  at com.onesignal.common.events.EventProducer.fire (EventProducer.kt:49)
  at com.onesignal.core.internal.application.impl.ApplicationService.setCurrent (ApplicationService.kt:50)
  at com.onesignal.core.internal.application.impl.ApplicationService.onActivityStarted (ApplicationService.kt:150)
  at android.app.Application.dispatchActivityStarted (Application.java:420)
  at android.app.Activity.dispatchActivityStarted (Activity.java:1451)
  at android.app.Activity.onStart (Activity.java:1969)
  at android.app.Instrumentation.callActivityOnStart (Instrumentation.java:1510)
  at android.app.Activity.performStart (Activity.java:8616)
  at android.app.ActivityThread.handleStartActivity (ActivityThread.java:4204)
  at android.app.servertransaction.TransactionExecutor.performLifecycleSequence (TransactionExecutor.java:221)
  at android.app.servertransaction.TransactionExecutor.cycleToPath (TransactionExecutor.java:201)
  at android.app.servertransaction.TransactionExecutor.executeLifecycleState (TransactionExecutor.java:173)
  at android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:97)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2574)
  at android.os.Handler.dispatchMessage (Handler.java:106)
  at android.os.Looper.loopOnce (Looper.java:226)
  at android.os.Looper.loop (Looper.java:313)
  at android.app.ActivityThread.main (ActivityThread.java:8757)
  at java.lang.reflect.Method.invoke
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:571)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1067)

Code of Conduct

  • I agree to follow this project's Code of Conduct

Thank you for this report, @christiaan. We are already investigating this crash happening in the same place as your stack trace. We will let you know when a fix is ready!

@jennantilla Hello!
Do you have any update on this issue?

@jennantilla can you link the issue in which that bug is tracked?

@jennantilla is there a way to speed this up?
Without a short solution timeline I have to consider moving to some OneSignal alternative.

@brayden-onesignal can you help out here?

or @gdeglin what can we do to get this fixed?