mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-09 08:04:45 +00:00
DiscoverLongFormFeedFilter.sort (and ~44 other feed filters/view models) sorted notes with the live DefaultFeedOrder comparator, which reads Note.createdAt() on every comparison. When another thread swaps a Note's event mid-sort (e.g. a newer replaceable/addressable event arriving from a relay), createdAt() changes between comparisons and TimSort throws "Comparison method violates its general contract!" (IllegalArgumentException). Migrate every amethyst Set<Note>/Iterable<Note> sort from sortedWith(DefaultFeedOrder) to the existing sortedByDefaultFeedOrder() helper, which snapshots createdAt() once per note so the comparator stays consistent. The pinned-chatroom comparator in ChatroomListKnownFeedFilter is given the same snapshot treatment. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011Sh5XNLssw9GJNxjkxZcRS