Skip to content

fix: emit membership.rejected event for specific error cases in event…#392

Merged
ggazzo merged 1 commit intomainfrom
dont-emit-on-invite
Mar 30, 2026
Merged

fix: emit membership.rejected event for specific error cases in event…#392
ggazzo merged 1 commit intomainfrom
dont-emit-on-invite

Conversation

@sampaiodiego
Copy link
Copy Markdown
Member

@sampaiodiego sampaiodiego commented Mar 30, 2026

… validation

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced membership event processing to more accurately identify and handle rejection scenarios for ban and leave actions when validation errors occur, with improved rejection reason reporting in federation scenarios.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 30, 2026

Caution

Review failed

Pull request was closed or merged during review

Walkthrough

The EventService now restricts special handling of UnknownRoomError for m.room.member events to only ban or leave membership transitions, emitting rejection events with the error message. Other validation failures continue processing as before.

Changes

Cohort / File(s) Summary
Membership Event Validation
packages/federation-sdk/src/services/event.service.ts
Added condition to restrict UnknownRoomError special handling on m.room.member events to only ban or leave membership transitions, emitting homeserver.matrix.membership.rejected with rejection reason.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10-15 minutes

Suggested labels

type: bug

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: emitting membership.rejected events for specific error cases in event validation, which aligns with the code changes that add conditional logic for UnknownRoomError on m.room.member events.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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.

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 50.80%. Comparing base (ce08545) to head (453180c).

Files with missing lines Patch % Lines
...kages/federation-sdk/src/services/event.service.ts 0.00% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #392      +/-   ##
==========================================
- Coverage   50.83%   50.80%   -0.04%     
==========================================
  Files         101      101              
  Lines       11475    11482       +7     
==========================================
  Hits         5833     5833              
- Misses       5642     5649       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 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.

@ggazzo ggazzo merged commit ee1fe2f into main Mar 30, 2026
3 of 4 checks passed
@ggazzo ggazzo deleted the dont-emit-on-invite branch March 30, 2026 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants