Skip to content

fix(federation): re-invite after ban#40114

Draft
sampaiodiego wants to merge 5 commits intodevelopfrom
fix/federation-second-reinvite-error
Draft

fix(federation): re-invite after ban#40114
sampaiodiego wants to merge 5 commits intodevelopfrom
fix/federation-second-reinvite-error

Conversation

@sampaiodiego
Copy link
Copy Markdown
Member

Proposed changes (including videos or screenshots)

Issue(s)

Steps to test or reproduce

Further comments

@dionisio-bot
Copy link
Copy Markdown
Contributor

dionisio-bot bot commented Apr 10, 2026

Looks like this PR is not ready to merge, because of the following issues:

  • This PR is missing the 'stat: QA assured' label
  • This PR is missing the required milestone or project

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 10, 2026

⚠️ No Changeset found

Latest commit: f6a1473

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 10, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a08be322-e887-4f52-9157-cc48d5c2163d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 10, 2026

Codecov Report

❌ Patch coverage is 11.11111% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.06%. Comparing base (5cff1f4) to head (f6a1473).
⚠️ Report is 3 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             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     
Flag Coverage Δ
unit 70.84% <11.11%> (-0.18%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.
@sampaiodiego sampaiodiego force-pushed the fix/federation-second-reinvite-error branch from 65673df to f6a1473 Compare April 13, 2026 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant