Skip to content

Conversation

@ggazzo
Copy link
Member

@ggazzo ggazzo commented Dec 2, 2025

https://rocketchat.atlassian.net/browse/FB-52

Proposed changes (including videos or screenshots)

Issue(s)

Steps to test or reproduce

Further comments

@changeset-bot
Copy link

changeset-bot bot commented Dec 2, 2025

⚠️ No Changeset found

Latest commit: 7204642

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

@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Dec 2, 2025

Looks like this PR is not ready to merge, because of the following issues:

  • This PR is missing the 'stat: QA assured' label
  • This PR is targeting the wrong base branch. It should target 7.14.0, but it targets 7.13.0

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 2, 2025

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/fed-emit

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.

@ggazzo ggazzo changed the title refactor: remove auto-join invite capability fix(federation): previous states on initial state and remove emitter Dec 2, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Dec 2, 2025

📦 Docker Image Size Report

📈 Changes

Service Current Baseline Change Percent
sum of all images 1.2GiB 1.2GiB +12MiB
rocketchat 359MiB 347MiB +12MiB
omnichannel-transcript-service 132MiB 132MiB +17KiB
queue-worker-service 132MiB 132MiB +16KiB
ddp-streamer-service 126MiB 126MiB +22KiB
account-service 113MiB 113MiB +16KiB
stream-hub-service 111MiB 111MiB +13KiB
presence-service 111MiB 111MiB +21KiB
authorization-service 111MiB 111MiB +17KiB

📊 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/15 22:28", "11/16 01:28", "11/17 23:50", "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/05 23:24 (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]
  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]
  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]
  line "omnichannel-transcript-service" [0.14, 0.14, 0.14, 0.14, 0.14, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13]
  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]
  line "queue-worker-service" [0.14, 0.14, 0.14, 0.14, 0.14, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13]
  line "rocketchat" [0.36, 0.36, 0.35, 0.35, 0.35, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.34, 0.35]
  line "stream-hub-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]
Loading

Statistics (last 14 days):

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

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

  • Tag: pr-37677
  • Baseline: develop
  • Timestamp: 2025-12-05 23:24:17 UTC
  • Historical data points: 14

Updated: Fri, 05 Dec 2025 23:24:17 GMT

@ggazzo ggazzo requested a review from Copilot December 3, 2025 17:46
Copilot finished reviewing on behalf of ggazzo December 3, 2025 17:49
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request refactors the federation-matrix package to use the SDK's built-in event emitter service instead of maintaining a local Emitter instance. The changes also improve error messages by adding contextual information.

Key Changes

  • Removes local Emitter instantiation and passes the SDK's eventEmitterService to event handlers instead
  • Updates all event handler functions to access federationSDK.eventEmitterService directly
  • Improves error messages in room event handlers by including roomId and userId context
  • Changes room name event handler to use sender field instead of state_key

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
ee/packages/federation-matrix/src/setup.ts Removes local Emitter instantiation and unused imports, simplifies initialization
ee/packages/federation-matrix/src/events/index.ts Updates function signatures to remove emitter parameter
ee/packages/federation-matrix/src/events/room.ts Changes event emitter usage, switches from state_key to sender field, improves error messages
ee/packages/federation-matrix/src/events/reaction.ts Updates to use SDK's event emitter service, removes unused imports
ee/packages/federation-matrix/src/events/ping.ts Updates to use SDK's event emitter service
ee/packages/federation-matrix/src/events/message.ts Updates to use SDK's event emitter service, consolidates imports
ee/packages/federation-matrix/src/events/member.ts Updates to use SDK's event emitter service, reorganizes imports
ee/packages/federation-matrix/src/events/edu.ts Updates to use SDK's event emitter service

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

throw new Error(`mapped room not found: ${roomId}`);
}

const localUserId = await Users.findOneByUsername(userId, { projection: { _id: 1 } });
Copy link

Copilot AI Dec 3, 2025

Choose a reason for hiding this comment

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

The sender field in Matrix events contains the full Matrix user ID (format: @username:server.domain), but Users.findOneByUsername() expects only the username part. This will cause the user lookup to fail. Use the getUsernameServername utility function to extract the username, similar to how it's done in the room.role event handler (line 63).

Copilot uses AI. Check for mistakes.
room_id: roomId,
content: { name },
state_key: userId,
sender: userId,
Copy link

Copilot AI Dec 3, 2025

Choose a reason for hiding this comment

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

The variable name userId is misleading as it contains the full Matrix user ID from sender (format: @username:server.domain), not just a local user ID. Consider renaming to senderId or senderMatrixId for clarity, and then use getUsernameServername() to extract the actual username before calling Users.findOneByUsername().

Copilot uses AI. Check for mistakes.
@codecov
Copy link

codecov bot commented Dec 5, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (feat/invites@fe34d35). Learn more about missing BASE report.

Additional details and impacted files

Impacted file tree graph

@@               Coverage Diff               @@
##             feat/invites   #37677   +/-   ##
===============================================
  Coverage                ?   54.17%           
===============================================
  Files                   ?     2638           
  Lines                   ?    50034           
  Branches                ?    11198           
===============================================
  Hits                    ?    27107           
  Misses                  ?    20781           
  Partials                ?     2146           
Flag Coverage Δ
e2e 57.27% <ø> (?)
e2e-api 43.16% <ø> (?)

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.

@ggazzo ggazzo force-pushed the chore/fed-emit branch 5 times, most recently from 82d2031 to 9525467 Compare December 5, 2025 21:23
@ggazzo ggazzo added this to the 7.14.0 milestone Dec 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants