Crash when forum messages try to get marked as read
A user reported that opening an existing forum with unread messages crashes the app once the view tries to mark some of the messages as read. Either when there are some unread messages directly on the view when opened or once scrolling to a position where unread messages appear.
This is the stacktrace:
17:21:47.900 [main] INFO org.briarproject.briar.desktop.Main - This is briar-desktop version 0.4.1-beta
17:21:47.901 [main] INFO org.briarproject.briar.desktop.Main - Build info:
17:21:47.901 [main] INFO org.briarproject.briar.desktop.Main - Git hash 227dfcfa07b4da07b494209d2058434929ea9ce5
17:21:47.902 [main] INFO org.briarproject.briar.desktop.Main - Commit time 2023-03-10 11:20:52
17:21:47.902 [main] INFO org.briarproject.briar.desktop.Main - Tag 0.4.1-beta
17:21:48.963 [AWT-EventQueue-0] INFO o.b.b.d.n.l.LibnotifyNotificationProvider - Notification server capabilities: actions, body, body-hyperlinks, body-images, body-markup, persistence
17:22:05.608 [AWT-EventQueue-0] WARN org.briarproject.briar.desktop.Main - Uncaught exception in thread AWT-EventQueue-0
java.util.NoSuchElementException: null
at org.briarproject.bramble.api.Multiset.remove(Multiset.java:62)
at org.briarproject.briar.desktop.ui.MessageCounterImpl.removeCount(MessageCounterImpl.kt:113)
at org.briarproject.briar.desktop.ui.MessageCounterImpl._init_$lambda$0(MessageCounterImpl.kt:93)
at org.briarproject.bramble.event.EventBusImpl.lambda$broadcast$0(EventBusImpl.java:42)
at org.briarproject.briar.desktop.DesktopCoreModule.provideUiExecutor$lambda$0(DesktopCoreModule.kt:157)
at org.briarproject.bramble.event.EventBusImpl.broadcast(EventBusImpl.java:41)
at org.briarproject.briar.desktop.forums.ThreadedConversationViewModel.markPostsRead(ThreadedConversationViewModel.kt:186)
at org.briarproject.briar.desktop.forums.GroupConversationScreenKt$GroupConversationScreen$3$2.invoke(GroupConversationScreen.kt:84)
at org.briarproject.briar.desktop.forums.GroupConversationScreenKt$GroupConversationScreen$3$2.invoke(GroupConversationScreen.kt:84)
at org.briarproject.briar.desktop.forums.ThreadedConversationScreenKt$ThreadedConversationScreen$2$2$1.invokeSuspend(ThreadedConversationScreen.kt:90)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at androidx.compose.ui.platform.FlushCoroutineDispatcher$dispatch$2$1.invoke(FlushCoroutineDispatcher.skiko.kt:62)
at androidx.compose.ui.platform.FlushCoroutineDispatcher$dispatch$2$1.invoke(FlushCoroutineDispatcher.skiko.kt:57)
at androidx.compose.ui.platform.FlushCoroutineDispatcher.performRun(FlushCoroutineDispatcher.skiko.kt:91)
at androidx.compose.ui.platform.FlushCoroutineDispatcher.access$performRun(FlushCoroutineDispatcher.skiko.kt:37)
at androidx.compose.ui.platform.FlushCoroutineDispatcher$dispatch$2.invokeSuspend(FlushCoroutineDispatcher.skiko.kt:57)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:771)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:722)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:716)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:741)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: null
akwizgran was also able to reproduce it.
Edited by Sebastian