Files
1cd0f0ebdb Fix stale channel members RHS list after ABAC access-rule member removal (#36964)
* Fix stale channel members RHS list after ABAC member removal

The channel members RHS list is built from the profilesInChannel and
membersInChannel Redux stores, which are only pruned by the user_removed
websocket handler when the affected channel is currently focused. When a
removal is not handled over the websocket (e.g. an ABAC access-rule change
processed while another channel is focused, or a missed event), reopening
the members list performs an additive reload that never prunes removed
members, so the list stays stale even though the member count is refreshed
separately via getChannelStats.

Make the first-page members reload authoritative: reconcile the channel
member stores against the server response and prune members the server no
longer returns. Scoped to the initial full-membership page to avoid
pruning members that belong to later pages.

Co-authored-by: mattermost-code <[email protected]>

* Add tests for channel members RHS reconcile on reload

Covers pruning members the server no longer returns on the first page,
and the guards that prevent pruning when reconcile is disabled, on a full
page (more pages may follow), or on subsequent pages.

Co-authored-by: mattermost-code <[email protected]>

* Strengthen channel members reconcile tests

Cover pruning across both the member and profile stores, multiple stale
members, the no-false-positive case (present members are never pruned),
and assert the members RHS passes reconcile=true on its first-page mount
reload (but not on pagination).

Co-authored-by: mattermost-code <[email protected]>

* Tighten reconcile tests with exact-set and perPage guard

Co-authored-by: mattermost-code <[email protected]>

* Tighten reconcile comment

Co-authored-by: mattermost-code <[email protected]>

* Add ABAC channel members RHS e2e coverage

* Stabilize ABAC RHS e2e sync job wait

---------

Co-authored-by: mattermost-code <[email protected]>

Co-authored-by: Hanzo Dev <[email protected]>
2026-06-11 07:38:18 -04:00
..