java.util.ConcurrentModificationException
Device: Samsung Galaxy A35 5G Andorid OS: Android 14 (SDK 34)
Exception java.util.ConcurrentModificationException: at java.util.ArrayList$Itr.checkForComodification (ArrayList.java:1111) at java.util.ArrayList$Itr.next (ArrayList.java:1064) at dev.patrickgold.jetpref.datastore.model.PreferenceModel$PersistenceHandler$loadPrefs$2$1$1$1.invokeSuspend (PreferenceModel.kt:304) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith (ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run (DispatchedTask.kt:100) at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run (LimitedDispatcher.java:124) at kotlinx.coroutines.scheduling.TaskImpl.run (Tasks.kt:89) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely (CoroutineScheduler.java:586) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask (CoroutineScheduler.kt:820) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker (CoroutineScheduler.kt:717) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run (CoroutineScheduler.kt:704)
Which version of JetPref did you use to produce this crash, and do you have a way to reproduce this consistently?
Version: v0.2.0-rc04 I use it with hilt with a @Singleton
I have some rough idea on what could go wrong, as it may be connected to https://github.com/florisboard/florisboard/issues/1726
I will test some things tomorrow and come back to you.
Your exception gave me some important hints to where JetPref's state bug originates => I will release 0.2 today and then start with 0.3 dev, where I will need to do some model rework (and breaking changes) to fix the state bug
Thank you. I will test it now.
Any updates? @patrickgold
Same Error. Version: 0.2
Exception java.util.ConcurrentModificationException: at java.util.ArrayList$Itr.checkForComodification (ArrayList.java:1111) at java.util.ArrayList$Itr.next (ArrayList.java:1064) at dev.patrickgold.jetpref.datastore.model.PreferenceModel$PersistenceHandler$loadPrefs$2$1$1$1.invokeSuspend (PreferenceModel.kt:304) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith (ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run (DispatchedTask.kt:100) at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run (LimitedDispatcher.java:124) at kotlinx.coroutines.scheduling.TaskImpl.run (Tasks.kt:89) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely (CoroutineScheduler.java:586) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask (CoroutineScheduler.kt:820) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker (CoroutineScheduler.kt:717) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run (CoroutineScheduler.kt:704)
=> I will release 0.2 today and then start with 0.3 dev
As stated here, I needed to do the 0.2 release because I want to rewrite the model internally (and a bit also the public API). Current dev work for first 0.3 beta is on the feat/jetprefv3 branch, but there is still testing to do by me, then I will open a draft PR and you can test the snapshot version.
=> I will release 0.2 today and then start with 0.3 dev
As stated here, I needed to do the 0.2 release because I want to rewrite the model internally (and a bit also the public API). Current dev work for first 0.3 beta is on the
feat/jetprefv3branch, but there is still testing to do by me, then I will open a draft PR and you can test the snapshot version.
Do you have a draft PR ready for today?
If today means CEST time zone then yes probably
If today means CEST time zone then yes probably
Can it be released today? Or can you tell me how to modify it? Currently, more than 1,000 users are affected by this.
Please see PR #22 for the draft new implementation, also having attached a snapshot version to test the new JetPref version.
Please see PR #22 for the draft new implementation, also having attached a snapshot version to test the new JetPref version.
How to use it?
As stated in the PR, add maven("https://central.sonatype.com/repository/maven-snapshots/") as a maven repo (only needed for snapshots), then set the JetPref version to 20250728T110348Z-SNAPSHOT.
Then have a look at the draft v3 README for applying KSP to your project (may already be applied depending on which libraries you use) and the datastore-model-processor artifact, and lastly you will have compiler errors because the API had some breaking changes, adapt these and then it should work again
Seems a bit cumbersome. Is it possible to release a beta version instead?
We are currently testing the snapshot in FlorisBoard to check how the new implementation behaves in a big project, then I'd release a beta release for JetPref.