-
Notifications
You must be signed in to change notification settings - Fork 20
fix: return origin on make-join response event #210
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
WalkthroughProfilesService.makeJoin now returns a member event augmented with an origin string. The Promise result shape changes to include event: PduForType<'m.room.member'> & { origin: string } and room_version: string. No other files or parameters changed. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Client
participant ProfilesService
Client->>ProfilesService: makeJoin(roomId, userId, versions)
activate ProfilesService
note right of ProfilesService: Build m.room.member event<br/>Augment with origin
ProfilesService-->>Client: { event: m.room.member & { origin }, room_version }
deactivate ProfilesService
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Please see the documentation for more information. Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).Please share your feedback with us on this Discord post. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #210 +/- ##
==========================================
- Coverage 81.01% 80.99% -0.02%
==========================================
Files 63 63
Lines 4692 4693 +1
==========================================
Hits 3801 3801
- Misses 891 892 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
packages/federation-sdk/src/services/profiles.service.ts (1)
76-78: Type tweak: use RoomVersion; origin intersection likely redundant
- Prefer
room_version: RoomVersionfor stronger typing.PduForType<'m.room.member'>likely already includesorigin; the intersection may be redundant (non-blocking).- ): Promise<{ - event: PduForType<'m.room.member'> & { origin: string }; - room_version: string; - }> { + ): Promise<{ + event: PduForType<'m.room.member'> & { origin: string }; + room_version: RoomVersion; + }> {
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Jira integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
packages/federation-sdk/src/services/profiles.service.ts(2 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
packages/federation-sdk/src/services/profiles.service.ts (1)
packages/room/src/types/_common.ts (1)
PduForType(14-14)
🔇 Additional comments (1)
packages/federation-sdk/src/services/profiles.service.ts (1)
105-108: Keep origin as the resident (responding) homeserver — do not set it to the joiner's domainMatrix S2S spec requires event.origin in make_join responses to be the resident/responding homeserver (the current code using this.configService.serverName is correct); do not derive origin from userId. (Matrix S2S API — GET /make_join: "origin — The name of the resident homeserver.")
Location: packages/federation-sdk/src/services/profiles.service.ts lines 105-108
Likely an incorrect or invalid review comment.
Summary by CodeRabbit
No user-facing changes; existing functionality remains unaffected.