mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-07-28 20:49:50 +00:00
* core: don't mark member support chat items read when reading group without scope Reading a group without a scope marked support-scope items read without decrementing the per-member support_chat_items_* counters, so members stayed unread in the support list even after their chat was fully read. Restrict the no-scope group read and its timed-items query to main-scope items. * plans: support chat unread on no-scope group read * core: update query plans for group scope read The main-scope read and timed-items queries now filter on group_scope_tag and group_scope_group_member_id, so they seek via idx_chat_items_group_scope_stats_all (5-column) instead of idx_chat_items_groups_user_mention (3-column). * plans: document query-plan and benchmark performance results * tests: fix unreliable support item id capture in no-scope group read test lastItemId returns the latest item by item_ts, which right after createGroup2 can be the group "connected" event rather than the just-sent support message. The per-item read then targeted the wrong (already-read, main-scope) item and never decremented the support counters, so the test failed regardless of the fix (consistently in CI, flakily locally depending on item ordering). Capture the support item id directly from the member-support scope instead, keeping the change contained to this test. Verified: the test passes with the fix and fails when the fix is reverted. * tests: fix name-shadowing build error in no-scope group read test The local pattern binding `itemId` shadowed the `itemId` helper imported from ChatTests.Utils, which -Wname-shadowing (Werror) rejects. Rename the local binding to `iId`.