Files
simplex-chat/apps
Narasimha-sc cf6ed70e70 ios: clamp unread at the apply point, not the debounced call site
342e270a1 clamped removeChatItem's decrement by reading unreadCount synchronously, but
UnreadCollector debounces ~1s, so the read saw a stale value: receiving an unread item then deleting
it within the window skipped the -1 and left the badge +1 too high - a regression, since the
unconditional -1 had netted to 0 in the collector. Revert that call-site clamp and instead clamp in
changeUnreadCounter(chatIndex:) - the point the accumulated delta is applied (its only caller is the
collector flush): clamp the per-chat count at 0 and feed the badge the clamped delta. Correct
regardless of debounce ordering, and still prevents the original negative drift.
2026-07-20 13:31:05 +00:00
..