mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-10 08:27:04 +00:00
BackwardRelayPager exposed five independently-updated StateFlows (exhausted, relayCount, stalledCount, reachedBack, relayProgress) that are all recomputed together on every page settle. Co-located consumers therefore paid up to five separate recompositions per settle and could observe a torn read (e.g. an updated relayCount against a still-stale relayProgress). Combine them into one atomic PagingStatus snapshot, emitted by a single publish(), collected once. updateStatus()/recomputeExhausted() merge into that publish() (exhausted computed inline). loadingMore stays separate: its falling edge is debounced on its own timer in PerRelayLoadTracker, decoupled from the status recompute, so folding it in would miss that delayed transition. Threaded through the 3 history managers and the 3 feed consumers (ChatroomListFeedView, ChatroomView, LoadingReplyNote): 12 collectors -> 4 at the heaviest views. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>