-
Notifications
You must be signed in to change notification settings - Fork 13k
refactor: standardize event handling in federation-matrix #37535
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Looks like this PR is ready to merge! 🎉 |
|
WalkthroughThe PR standardizes event payload access patterns across federation-matrix event handlers by refactoring handlers to destructure and access event objects consistently. Instead of receiving raw wrapper data, handlers now directly read from nested event payloads, replacing all Changes
Sequence DiagramsequenceDiagram
participant Emitter
participant Handler
participant Logic
rect rgb(200, 220, 240)
Note over Emitter,Handler: Before Refactoring
Emitter->>Handler: emit(event, {event: {...}, data: {...}})
Handler->>Handler: data = payload<br/>access via data.event.sender
Handler->>Logic: process(data.event.*)
end
rect rgb(220, 240, 200)
Note over Emitter,Handler: After Refactoring
Emitter->>Handler: emit(event, {event: {...}})
Handler->>Handler: destructure { event }<br/>access via event.sender
Handler->>Logic: process(event.*)
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (4)
🧰 Additional context used🧠 Learnings (4)📓 Common learnings📚 Learning: 2025-10-28T16:53:42.761ZApplied to files:
📚 Learning: 2025-11-04T16:49:19.107ZApplied to files:
📚 Learning: 2025-09-19T15:15:04.642ZApplied to files:
🧬 Code graph analysis (2)ee/packages/federation-matrix/src/events/message.ts (3)
ee/packages/federation-matrix/src/events/member.ts (2)
🔇 Additional comments (9)
Tip 📝 Customizable high-level summaries are now available in beta!You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.
Example:
Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later. 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 |
…structured event objects Updated event handlers in member, message, reaction, and room modules to use destructured event objects for improved readability and consistency. This change enhances the clarity of the code by directly accessing event properties, reducing the need for repetitive data extraction.
f6be320 to
031911c
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #37535 +/- ##
========================================
Coverage 68.97% 68.97%
========================================
Files 3358 3358
Lines 114228 114228
Branches 20537 20537
========================================
+ Hits 78784 78786 +2
+ Misses 33351 33350 -1
+ Partials 2093 2092 -1
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
https://rocketchat.atlassian.net/browse/FB-58
Updated event handlers in member, message, reaction, and room modules to use destructured event objects for improved readability and consistency. This change enhances the clarity of the code by directly accessing event properties, reducing the need for repetitive data extraction.
Proposed changes (including videos or screenshots)
Issue(s)
Steps to test or reproduce
Further comments
Summary by CodeRabbit