Skip to content

Conversation

@sampaiodiego
Copy link
Member

@sampaiodiego sampaiodiego commented Jan 19, 2026

Proposed changes (including videos or screenshots)

Issue(s)

FEDCORE-5

Steps to test or reproduce

Further comments

Summary by CodeRabbit

Release Notes

  • New Features

    • Room topics now propagate and synchronize between Rocket.Chat and Matrix when creating federated rooms.
  • Tests

    • Added comprehensive end-to-end testing for room topic handling in federated room scenarios.

✏️ Tip: You can customize this high-level summary in your review settings.

@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Jan 19, 2026

Looks like this PR is ready to merge! 🎉
If you have any trouble, please check the PR guidelines

@changeset-bot
Copy link

changeset-bot bot commented Jan 19, 2026

⚠️ No Changeset found

Latest commit: fe9b08e

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

@sampaiodiego sampaiodiego added this to the 8.1.0 milestone Jan 19, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 19, 2026

Walkthrough

The changes add functionality to set a room topic on Matrix-based federated rooms during room creation. After successfully creating a Matrix room, if a topic is provided, the code invokes federationSDK.setRoomTopic() before persisting the federated room mapping. Comprehensive end-to-end tests verify topic propagation on both Rocket.Chat and Matrix sides.

Changes

Cohort / File(s) Summary
Implementation
ee/packages/federation-matrix/src/FederationMatrix.ts
Conditional topic-setting logic added in createRoom method. After Matrix room creation, if the input room has a topic, invokes federationSDK.setRoomTopic() with the Matrix room ID, encoded creator ID, and topic before persisting the federated room mapping.
Tests
ee/packages/federation-matrix/tests/end-to-end/room.spec.ts
New end-to-end test suite covering topic propagation scenarios: federated room creation with/without topics, verification of topic presence/absence on Rocket.Chat room info and Matrix state events, federation metadata validation (federated flag, mrid). Imports added for Room type and EventTimeline.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

stat: QA assured

Suggested reviewers

  • ggazzo
  • rodrigok

Poem

🐰 A topic finds its destined place,
Across the federated matrix space,
From Rocket to the rooms so far,
No longer lost without a star,
The words now travel, echo true,
Where federation binds what's new! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title clearly summarizes the main change: setting room topic on creation of federated rooms, which directly matches the code modifications.
Linked Issues check ✅ Passed The code changes implement the core requirement from FEDCORE-5: conditionally setting room topic when federated rooms are created, with comprehensive test coverage validating topic propagation.
Out of Scope Changes check ✅ Passed All changes are directly scoped to fixing room topic propagation on federated room creation, with no unrelated modifications detected.
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.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-federation-room-topic-on-creation

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

codecov bot commented Jan 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.71%. Comparing base (90243eb) to head (fe9b08e).
⚠️ Report is 16 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop   #38264   +/-   ##
========================================
  Coverage    70.70%   70.71%           
========================================
  Files         3139     3139           
  Lines       108744   108744           
  Branches     19560    19601   +41     
========================================
+ Hits         76887    76897   +10     
+ Misses       29856    29848    -8     
+ Partials      2001     1999    -2     
Flag Coverage Δ
e2e 60.30% <ø> (-0.01%) ⬇️
e2e-api 48.03% <ø> (+0.07%) ⬆️
unit 71.81% <ø> (ø)

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.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 19, 2026

📦 Docker Image Size Report

➡️ Changes

Service Current Baseline Change Percent
sum of all images 0B 0B 0B
account-service 0B 0B 0B
authorization-service 0B 0B 0B
ddp-streamer-service 0B 0B 0B
omnichannel-transcript-service 0B 0B 0B
presence-service 0B 0B 0B
queue-worker-service 0B 0B 0B
rocketchat 0B 0B 0B

📊 Historical Trend

---
config:
  theme: "dark"
  xyChart:
    width: 900
    height: 400
---
xychart
  title "Image Size Evolution by Service (Last 30 Days + This PR)"
  x-axis ["11/18 22:53", "11/19 23:02", "11/21 16:49", "11/24 17:34", "11/27 22:32", "11/28 19:05", "12/01 23:01", "12/02 21:57", "12/03 21:00", "12/04 18:17", "12/05 21:56", "12/08 20:15", "12/09 22:17", "12/10 23:26", "12/11 21:56", "12/12 22:45", "12/13 01:34", "12/15 22:31", "12/16 22:18", "12/17 21:04", "12/18 23:12", "12/19 23:27", "12/20 21:03", "12/22 18:54", "12/23 16:16", "12/24 19:38", "12/25 17:51", "12/26 13:18", "12/29 19:01", "12/30 20:52", "01/19 20:29 (PR)"]
  y-axis "Size (GB)" 0 --> 0.5
  line "account-service" [0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.00]
  line "authorization-service" [0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.00]
  line "ddp-streamer-service" [0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.00]
  line "omnichannel-transcript-service" [0.14, 0.14, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.00]
  line "presence-service" [0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.00]
  line "queue-worker-service" [0.14, 0.14, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.00]
  line "rocketchat" [0.35, 0.35, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.00]
Loading

Statistics (last 30 days):

  • 📊 Average: 1.5GiB
  • ⬇️ Minimum: 1.4GiB
  • ⬆️ Maximum: 1.6GiB
  • 🎯 Current PR: 0B
ℹ️ About this report

This report compares Docker image sizes from this build against the develop baseline.

  • Tag: pr-38264
  • Baseline: develop
  • Timestamp: 2026-01-19 20:29:19 UTC
  • Historical data points: 30

Updated: Mon, 19 Jan 2026 20:29:20 GMT

@sampaiodiego sampaiodiego marked this pull request as ready for review January 19, 2026 20:15
Copy link
Contributor

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

1 issue found across 2 files

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="ee/packages/federation-matrix/tests/end-to-end/room.spec.ts">

<violation number="1" location="ee/packages/federation-matrix/tests/end-to-end/room.spec.ts:763">
P2: Guard the `topic` event before calling `getContent()` (or assert it’s defined) so the test fails cleanly and doesn’t throw when the state hasn’t synced yet.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.


const [topic] = hs1Room1.getLiveTimeline().getState(EventTimeline.FORWARDS)?.getStateEvents('m.room.topic') || [];

expect(topic.getContent().topic).toBe(channelTopic);
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Jan 19, 2026

Choose a reason for hiding this comment

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

P2: Guard the topic event before calling getContent() (or assert it’s defined) so the test fails cleanly and doesn’t throw when the state hasn’t synced yet.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At ee/packages/federation-matrix/tests/end-to-end/room.spec.ts, line 763:

<comment>Guard the `topic` event before calling `getContent()` (or assert it’s defined) so the test fails cleanly and doesn’t throw when the state hasn’t synced yet.</comment>

<file context>
@@ -713,6 +715,102 @@ import { SynapseClient } from '../helper/synapse-client';
+
+					const [topic] = hs1Room1.getLiveTimeline().getState(EventTimeline.FORWARDS)?.getStateEvents('m.room.topic') || [];
+
+					expect(topic.getContent().topic).toBe(channelTopic);
+				});
+			});
</file context>
Fix with Cubic

@ggazzo ggazzo added the stat: QA assured Means it has been tested and approved by a company insider label Jan 21, 2026
@ggazzo ggazzo merged commit eb5a1ef into develop Jan 21, 2026
46 checks passed
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Jan 21, 2026
@ggazzo ggazzo deleted the fix-federation-room-topic-on-creation branch January 21, 2026 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stat: QA assured Means it has been tested and approved by a company insider stat: ready to merge PR tested and approved waiting for merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants