fix(federation): re-invite after ban#40114
Conversation
|
Looks like this PR is not ready to merge, because of the following issues:
Please fix the issues and try again If you have any trouble, please check the PR guidelines |
|
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #40114 +/- ##
===========================================
- Coverage 70.18% 70.06% -0.13%
===========================================
Files 3279 3281 +2
Lines 116798 117091 +293
Branches 20714 20756 +42
===========================================
+ Hits 81977 82042 +65
- Misses 31528 31757 +229
+ Partials 3293 3292 -1
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
When a user undergoes multiple Ban -> Unban -> Re-invite cycles in a federated room, the leave event from the unban can arrive after a new INVITED subscription has been created. The handleLeave function currently treats any non-banned subscription as a regular leave, deleting the new INVITED subscription and locking the user out with "You've been removed from room" error.
When a federated user is unbanned and re-invited in a single operation, the unban sends a leave event to Matrix. If this leave event arrives after a new INVITED subscription has already been created, handleLeave was incorrectly treating it as a regular leave and calling performUserRemoval — deleting the valid INVITED subscription and showing "You've been removed from room" to the user. Now handleLeave checks for INVITED status before removing, and skips the stale leave event so the pending invite is preserved.
65673df to
f6a1473
Compare
Proposed changes (including videos or screenshots)
Issue(s)
Steps to test or reproduce
Further comments