Skip to content

fix: ConcurrentModificationException in repostAuthors#424

Merged
barrydeen merged 1 commit intomainfrom
fix/repost-authors-concurrent-modification
Apr 5, 2026
Merged

fix: ConcurrentModificationException in repostAuthors#424
barrydeen merged 1 commit intomainfrom
fix/repost-authors-concurrent-modification

Conversation

@barrydeen
Copy link
Copy Markdown
Owner

Summary

  • Crash reported on Samsung SM-A546U (Android 13) — ConcurrentModificationException at EventRepository.isRepostedByAny
  • Root cause: repostAuthors LruCache stored plain LinkedHashSet instances written from relay IO coroutines and iterated from the feed filter coroutine on Dispatchers.Default
  • Replace mutableSetOf() with ConcurrentHashMap.newKeySet() at all four creation sites so concurrent add/iterate is safe

Test plan

  • Install on device, follow active accounts, rapidly scroll/refresh feed while events stream in
  • Monitor adb logcat -s AndroidRuntime for crashes
  • Verify reposts still display correctly in feed

…cationException

repostAuthors stored plain LinkedHashSet instances that were written to
from relay IO coroutines and iterated from the feed filter coroutine on
Dispatchers.Default. Replace with ConcurrentHashMap.newKeySet() at all
four creation sites so concurrent add/iterate is safe.

Fixes crash on Samsung SM-A546U (Android 13) at
EventRepository.isRepostedByAny.
@barrydeen barrydeen merged commit d6c7874 into main Apr 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant