fix: receive invite_room_state as invite param#286
Conversation
WalkthroughThe invite processing flow is refactored to accept pre-filtered stripped state events instead of the full member event object. Room privacy checks now inspect strippedStateEvents directly to determine encryption and join rules. The federation controller passes invite_room_state from the request body to the updated service method. Changes
Sequence DiagramsequenceDiagram
participant Controller as Federation Controller
participant Service as InviteService
Note over Controller,Service: Before: event-based processing
Controller->>Service: processInvite(event, roomId, ...)
Service->>Service: shouldProcessInvite(event)
Note over Service: Inspects event.unsigned.invite_room_state
Service-->>Controller: Accept/Reject
Note over Controller,Service: After: strippedStateEvents-based processing
Controller->>Service: processInvite(event, roomId, ..., strippedStateEvents)
Service->>Service: shouldProcessInvite(strippedStateEvents)
Note over Service: Inspects strippedStateEvents for join_rules & encryption
Service-->>Controller: Accept/Reject
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 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 (2)
🧰 Additional context used🧬 Code graph analysis (1)packages/federation-sdk/src/services/invite.service.ts (1)
🔇 Additional comments (3)
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✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #286 +/- ##
=======================================
Coverage 60.49% 60.49%
=======================================
Files 67 67
Lines 6675 6675
=======================================
Hits 4038 4038
Misses 2637 2637 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary by CodeRabbit