Skip to content

chore(federation): update typings to match EventEmitter property pruning#37570

Merged
ggazzo merged 1 commit intodevelopfrom
chore/fed-event-emitter-typings
Nov 21, 2025
Merged

chore(federation): update typings to match EventEmitter property pruning#37570
ggazzo merged 1 commit intodevelopfrom
chore/fed-event-emitter-typings

Conversation

@ricardogarim
Copy link
Contributor

@ricardogarim ricardogarim commented Nov 21, 2025

Fixes the two leftover typing mismatches from RocketChat/homeserver#299 to fully align with pruned event payloads.

Summary by CodeRabbit

  • Refactor
    • Updated event handling and type structures for improved consistency and maintainability in federation matrix integration.

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

@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Nov 21, 2025

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

  • 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

@changeset-bot
Copy link

changeset-bot bot commented Nov 21, 2025

⚠️ No Changeset found

Latest commit: 6f5f5cb

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 21, 2025

Walkthrough

The changes standardize event payload handling in federation-matrix event handlers by converting the room name handler to destructure event objects instead of flat payloads, and updating the message content type alias to reference the nested event structure.

Changes

Cohort / File(s) Summary
Event Handler Updates
ee/packages/federation-matrix/src/events/room.ts
Modified the homeserver.matrix.room.name event handler to consume an event object, extracting room_id, content.name, and sender as roomId, name, and userId respectively. Core logic for room lookup and name persistence remains unchanged.
Type Definitions
ee/packages/federation-matrix/src/helpers/message.parsers.ts
Updated the MatrixMessageContent type alias path from HomeserverEventSignatures['homeserver.matrix.message']['content'] to HomeserverEventSignatures['homeserver.matrix.message']['event']['content'], maintaining the optional format?: string suffix.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Straightforward payload restructuring with no logic changes
  • Type alias path update is a mechanical change
  • Both modifications are isolated and follow a consistent pattern

Possibly related PRs

Suggested labels

stat: ready to merge

Suggested reviewers

  • sampaiodiego

Poem

🐰 Events now flow in nested streams,
Structured payloads, organized dreams,
Room names extracted with care and grace,
Types aligned in their rightful place,
Matrix federation, refactored with ease! 🎉

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: updating typings to match EventEmitter property pruning, which aligns with fixing typing mismatches from event payload changes across two files.
✨ 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 chore/fed-event-emitter-typings

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.

@ricardogarim ricardogarim changed the title chore: update typings to match EventEmitter property pruning chore(federation): update typings to match EventEmitter property pruning Nov 21, 2025
@ricardogarim ricardogarim requested a review from ggazzo November 21, 2025 13:18
@github-actions
Copy link
Contributor

📦 Docker Image Size Report

📈 Changes

Service Current Baseline Change Percent
sum of all images 1.2GiB 1.2GiB +12MiB
rocketchat 367MiB 355MiB +12MiB
omnichannel-transcript-service 141MiB 141MiB +661B
queue-worker-service 141MiB 141MiB +433B
ddp-streamer-service 127MiB 127MiB +639B
account-service 114MiB 114MiB -352B
stream-hub-service 111MiB 111MiB -259B
authorization-service 111MiB 111MiB +301B
presence-service 111MiB 111MiB -264B

📊 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 13:25 (PR)"]
  y-axis "Size (GB)" 0 --> 0.5
  line "account-service" [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]
  line "ddp-streamer-service" [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.14]
  line "presence-service" [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.14]
  line "rocketchat" [0.36, 0.36, 0.35, 0.35, 0.35, 0.36]
  line "stream-hub-service" [0.11, 0.11, 0.11, 0.11, 0.11, 0.11]
Loading

Statistics (last 5 days):

  • 📊 Average: 1.4GiB
  • ⬇️ 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-37570
  • Baseline: develop
  • Timestamp: 2025-11-21 13:25:13 UTC
  • Historical data points: 5

Updated: Fri, 21 Nov 2025 13:25:14 GMT

@codecov
Copy link

codecov bot commented Nov 21, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.92%. Comparing base (7f1b834) to head (6f5f5cb).
⚠️ Report is 3 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #37570      +/-   ##
===========================================
- Coverage    68.94%   68.92%   -0.02%     
===========================================
  Files         3360     3360              
  Lines       114282   114277       -5     
  Branches     20562    20561       -1     
===========================================
- Hits         78790    78765      -25     
- Misses       33406    33425      +19     
- Partials      2086     2087       +1     
Flag Coverage Δ
e2e 57.43% <ø> (-0.02%) ⬇️
e2e-api 42.55% <ø> (-0.95%) ⬇️

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 modified the milestones: 7.10.3, 7.13.0, 7.14.0 Nov 21, 2025
@ggazzo ggazzo added the stat: QA assured Means it has been tested and approved by a company insider label Nov 21, 2025
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Nov 21, 2025
@ggazzo ggazzo merged commit f36859b into develop Nov 21, 2025
131 of 139 checks passed
@ggazzo ggazzo deleted the chore/fed-event-emitter-typings branch November 21, 2025 15:26
@dougfabris dougfabris modified the milestones: 7.14.0, 8.0.0 Jan 19, 2026
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