Skip to content

Conversation

@juliajforesti
Copy link
Contributor

@juliajforesti juliajforesti commented Sep 19, 2025

FDR-82
FDR-135

Proposed changes (including videos or screenshots)

Join button was incorrectly being displayed after creating a private federated room, due to Subscriptions store change not being notified, so the created room was not found on the store instantly, requiring a reload or changing routes.

Issue(s)

Steps to test or reproduce

Further comments

Summary by CodeRabbit

  • Bug Fixes
    • Fixed composer incorrectly showing a “Join” button after creating a federated room.
    • You can now send messages immediately in newly created federated rooms without reloading or navigating away.
    • Improved real-time reactivity so room state updates are reflected promptly after creation.

@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Sep 19, 2025

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 Sep 19, 2025

🦋 Changeset detected

Latest commit: 6dbacd3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 39 packages
Name Type
@rocket.chat/meteor Patch
@rocket.chat/core-typings Patch
@rocket.chat/rest-typings Patch
@rocket.chat/uikit-playground Patch
@rocket.chat/api-client Patch
@rocket.chat/apps Patch
@rocket.chat/core-services Patch
@rocket.chat/cron Patch
@rocket.chat/ddp-client Patch
@rocket.chat/freeswitch Patch
@rocket.chat/fuselage-ui-kit Patch
@rocket.chat/gazzodown Patch
@rocket.chat/http-router Patch
@rocket.chat/livechat Patch
@rocket.chat/model-typings Patch
@rocket.chat/ui-avatar Patch
@rocket.chat/ui-client Patch
@rocket.chat/ui-contexts Patch
@rocket.chat/web-ui-registration Patch
@rocket.chat/account-service Patch
@rocket.chat/authorization-service Patch
@rocket.chat/ddp-streamer Patch
@rocket.chat/omnichannel-transcript Patch
@rocket.chat/presence-service Patch
@rocket.chat/queue-worker Patch
@rocket.chat/stream-hub-service Patch
@rocket.chat/license Patch
@rocket.chat/omnichannel-services Patch
@rocket.chat/pdf-worker Patch
@rocket.chat/presence Patch
rocketchat-services Patch
@rocket.chat/models Patch
@rocket.chat/network-broker Patch
@rocket.chat/omni-core-ee Patch
@rocket.chat/mock-providers Patch
@rocket.chat/ui-video-conf Patch
@rocket.chat/ui-voip Patch
@rocket.chat/instance-status Patch
@rocket.chat/omni-core Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 19, 2025

Walkthrough

Adds a changeset entry for a patch release and modifies the federation branch of createRoom to emit an additional subscription-changed notification immediately after inserting a subscription, addressing composer Join button reactivity when creating federated rooms.

Changes

Cohort / File(s) Summary
Release notes / Changeset
\.changeset/pink-pens-march.md
Adds patch note for @rocket.chat/meteor documenting a bug fix about composer Join button reactivity in federated room creation.
Federation subscription notifications
apps/meteor/app/lib/server/functions/createRoom.ts
In the federation path of createUsersSubscriptions, after inserting a subscription, calls notifyOnSubscriptionChangedById(insertedId, 'inserted') before returning; existing notifyOnRoomChanged remains. No exported API changes.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant C as Client
  participant S as createRoom (Server)
  participant F as Federation
  participant DB as DB/Subscriptions
  participant N as Notifier

  C->>S: createRoom(federated)
  S->>F: resolve federated context
  S->>DB: insert subscription
  DB-->>S: insertedId
  rect rgba(230, 246, 255, 0.6)
    note right of S: New step
    S->>N: notifyOnSubscriptionChangedById(insertedId, "inserted")
  end
  S->>N: notifyOnRoomChanged(roomId, "changed")
  S-->>C: return room/subscription info
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I nudge the wires with a twitching nose,
A tiny ping where the status goes.
“Inserted!” I squeak—alerts take flight,
No more reloads in the chatty night.
Patch-sized hop, federation cheer,
Buttons behave—all clear, my dear. 🐇✨

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 "fix: missing reactivity when creating a federated room" directly and concisely describes the main change in this PR: addressing a reactivity bug when creating federated rooms so the Subscriptions store is properly notified (matches the added notifyOnSubscriptionChangedById after subscription insert). It is specific, clear, and suitable for teammates scanning history.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/federated-room-create

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link

codecov bot commented Sep 19, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.21%. Comparing base (f139c0d) to head (6dbacd3).
⚠️ Report is 24 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop   #37007   +/-   ##
========================================
  Coverage    66.21%   66.21%           
========================================
  Files         3384     3384           
  Lines       115027   115027           
  Branches     21064    21069    +5     
========================================
+ Hits         76161    76167    +6     
+ Misses       36260    36253    -7     
- Partials      2606     2607    +1     
Flag Coverage Δ
e2e 56.98% <ø> (-0.03%) ⬇️
unit 71.20% <ø> (+0.02%) ⬆️

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.

@juliajforesti juliajforesti marked this pull request as ready for review September 22, 2025 19:07
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 (2)
.changeset/pink-pens-march.md (1)

5-5: Polish the release note for clarity.

Minor copy edit to improve grammar and flow.

-Fixes reactivity when creating a federated room, that was wrongly showing Join button on composer, requiring a reload or change of route to be able to send a message.
+Fixes reactivity when creating a federated room, which incorrectly showed the Join button in the composer and required a reload or route change to send a message.
apps/meteor/app/lib/server/functions/createRoom.ts (1)

55-58: Double room “inserted” notifications — confirm intent or make non‑blocking.

This block emits notifyOnRoomChanged(room, 'inserted'), and the top‑level flow emits the same event at Line 252. If the duplicate is unnecessary, consider making this inner call non‑blocking for consistency, or removing it.

-            await notifyOnSubscriptionChangedById(insertedId, 'inserted');
-            await notifyOnRoomChanged(room, 'inserted');
+            await notifyOnSubscriptionChangedById(insertedId, 'inserted');
+            void notifyOnRoomChanged(room, 'inserted'); // keep event, avoid blocking and align with Line 252
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b76d99b and 6dbacd3.

📒 Files selected for processing (2)
  • .changeset/pink-pens-march.md (1 hunks)
  • apps/meteor/app/lib/server/functions/createRoom.ts (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
apps/meteor/app/lib/server/functions/createRoom.ts (1)
apps/meteor/app/lib/server/lib/notifyListener.ts (1)
  • notifyOnSubscriptionChangedById (535-544)
🔇 Additional comments (2)
.changeset/pink-pens-march.md (1)

1-3: Semver and package scope look correct.

Patch bump for @rocket.chat/meteor matches the fix scope.

apps/meteor/app/lib/server/functions/createRoom.ts (1)

55-58: Good: emit subscription change for the federation path to restore reactivity.

Calling notifyOnSubscriptionChangedById(insertedId, 'inserted') aligns the federation path with the non‑federation flow and fixes the Join‑button state.

@rodrigok rodrigok added this to the 7.11.0 milestone Sep 22, 2025
@ggazzo ggazzo added the stat: QA assured Means it has been tested and approved by a company insider label Sep 23, 2025
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Sep 23, 2025
@ggazzo ggazzo merged commit fd9d32d into develop Sep 23, 2025
147 of 154 checks passed
@ggazzo ggazzo deleted the fix/federated-room-create branch September 23, 2025 14:59
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.

4 participants