plusonelabs / calendar-widget

An calender widget for your Android home screen.
Apache License 2.0
370 stars 127 forks source link

ConcurrentModificationException when updating event list #187

Closed mpost closed 9 years ago

mpost commented 9 years ago

As reported in the Google Play Store. The issue is new in the 1.9.x release.

java.util.ConcurrentModificationException
at java.util.ArrayList$ArrayListIterator.next(ArrayList.java:573)
at java.util.AbstractCollection.toString(AbstractCollection.java:372)
at com.plusonelabs.calendar.EventRemoteViewsFactory.updateEntryList(EventRemoteViewsFactory.java:125)
at com.plusonelabs.calendar.EventRemoteViewsFactory.onDataSetChanged(EventRemoteViewsFactory.java:102)
at android.widget.RemoteViewsService$RemoteViewsFactoryAdapter.onDataSetChanged(RemoteViewsService.java:142)
at android.widget.RemoteViewsService$RemoteViewsFactoryAdapter.onDataSetChangedAsync(RemoteViewsService.java:149)
at com.android.internal.widget.IRemoteViewsFactory$Stub.onTransact(IRemoteViewsFactory.java:56)
at android.os.Binder.execTransact(Binder.java:404)
at dalvik.system.NativeStart.run(Native Method)
yvolk commented 9 years ago

As I see, the code, which works with a list of "eventEntries", doesn't take concurrency into account. E.g. it looks like onDataSetChanged function may be called even before previous call to it was not completed (i.e. the calls are not serialized). This mostly worked Ok, when logic inside the call was simpler and executed quicker.

mpost commented 9 years ago

We have fixed the issue and are now starting to make use of the public beta testing channel. Please feel free to opt in and see if the fix works for you: https://play.google.com/apps/testing/com.plusonelabs.calendar (might take a bit until the link becomes active)