Fix flawed membership checks and align membership checking patterns
Spawning from https://github.com/matrix-org/complement/pull/808 per my suggestion on https://github.com/matrix-org/complement/pull/808#discussion_r2445478145,
We have other spots that have flawed membership checks that need to be fixed. For example, when our goal is to wait for the user's membership to be leave, we should keep checking until it is leave. Currently, there are some spots that wait until any membership exists for the user and then asserts leave on that which is flawed because that user may have previous membership events that may be picked up first instead of waiting for the leave.
This PR fixes those flawed checks and aligns our membership checks so we don't cargo cult this bad pattern elsewhere.
- Generalize our
client.SyncXXXhelpers to usesyncMembershipInutility- More robust
- Standardize extra
checkson event (previously, only available withclient.SyncJoinedTo)
- Introduce
client.SyncBannedFromso we can differentiate ban/leave
Dev notes
- https://github.com/matrix-org/complement/pull/272
- https://github.com/matrix-org/complement/pull/511
Pull Request Checklist
- [x] Pull request includes a sign off
Signed-off-by: Eric Eastwood [email protected]