Visitar URL original
regression: XMPP hosted rooms leave occupants uninformed of corrections, topic changes and kicks by sampaiodiego · Pull Request #43317 · RocketChat/Rocket.Chat · GitHub
Skip to content

regression: XMPP hosted rooms leave occupants uninformed of corrections, topic changes and kicks - #43317

Draft
sampaiodiego wants to merge 3 commits into
developfrom
fix/xmpp-hosted-room-notifications
Draft

sampaiodiego wants to merge 3 commits into
developfrom
fix/xmpp-hosted-room-notifications

Conversation

@sampaiodiego

@sampaiodiego sampaiodiego commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Proposed changes (including videos or screenshots)

Fixes three things XMPP occupants of a room Rocket.Chat hosts were never told. All three are in the protocol core's MucRoom, with no Rocket.Chat-side changes. There is one commit per defect, and each un-skips the test that pins it and updates the spec in the same commit.

Commit Spec Before After
Relay corrections between hosted-room occupants as corrections message-corrections D2 (R5) The room rebuilt every message it relayed from body and id alone, so an XMPP occupant's correction reached the other XMPP occupants without <replace/> and showed as a new message. The room relays the replace id it already parsed.
Tell hosted-room occupants about a new topic hosted-muc D3, now R19 A topic changed in Rocket.Chat became the subject only for whoever joined next. Every remote occupant gets a groupchat with the new <subject/> when it changes (XEP-0045 §8.1). It comes from the bare room JID, since no occupant made the change. Re-registering the room with an unchanged topic sends nothing.
Tell a kicked XMPP user they were removed from a hosted room hosted-muc D1 (R9) The other occupants got the 307 unavailable presence, but the removed user did not, so their client kept showing them in the room. The kicked occupant first gets their own unavailable presence with 307 and 110 (XEP-0045 §8.2), then the others get 307.

No changeset: the XMPP server has not been released yet (.changeset/native-xmpp-server.md is still pending).

Issue(s)

Steps to test or reproduce

  • yarn testunit in ee/packages/xmpp-server: 25 suites, 229 passed, 4 skipped. There is a new MucRoom unit test per fix, and a mutation check confirmed the correction-relay test fails without its fix.

  • End-to-end against the Openfire stack, hosted-muc.spec.ts, run as the whole "private group" block plus the topic test, because those tests build on each other. All three failed on the develop service image:

    • The correction arrived with no replace id: undefined !== 'e2e-…'.
    • "timed out … waiting for his own removal".
    • "timed out … waiting for the new subject".

    On this branch's image the block passes 14/14.

  • Full e2e suite: develop 65 pass, 1 fail, 12 skipped; this branch 68 pass, 1 fail, 9 skipped. The failure is presence R5 on both, an order-dependent test fixed in test(xmpp-server): run the account service and DDP streamer in the Openfire stack #43299.

Further comments

  • The plan was to make MucRoom.kick take the status code now, so the ban fix can send 301 (XEP-0045 §9.1). I left that to the ban PR, which is the first caller to need it.
  • docs/README.md's example // Known defect: anchor pointed at hosted-muc D1. It now points at hosted-muc D5, which stays open. The worked examples in docs/examples.md that tell how D1 and D3 were recorded and fixed are left as they are.

🤖 Generated with Claude Code

View guided diff

…corrections

message-corrections D2: a hosted room rebuilt every message it relayed from
body and id alone, so a correction from one XMPP occupant reached the others
without its <replace/> and their clients showed it as a new message. The room
now relays the replace id it parsed, as R5 requires.
hosted-muc D3: a topic changed in Rocket.Chat became the subject only for
whoever joined next, while occupants already in the room kept the old one.
The room now sends every remote occupant the new subject when it changes, as
XEP-0045 §8.1 asks, from the bare room JID since no occupant made the change.
The hosted-muc spec states this as R19.
…sted room

hosted-muc D1: when Rocket.Chat removed an XMPP user from a room it hosts, the
other occupants got the unavailable presence with status 307 but the removed
user did not, because the occupant was dropped before the recipients were
listed. Their client kept showing them in the room. The kicked occupant now
gets their own unavailable presence with 307 and 110 first (XEP-0045 §8.2);
R9 says so.
@dionisio-bot

dionisio-bot Bot commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

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

  • This PR is still a draft
  • This PR is missing the 'stat: QA assured' label
  • This PR is missing the required milestone or project

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@changeset-bot

changeset-bot Bot commented Oct 29, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 0cb8b98

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

coderabbitai Bot commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@codecov

codecov Bot commented Oct 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.34%. Comparing base (d760352) to head (0cb8b98).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #43317      +/-   ##
===========================================
+ Coverage    72.33%   72.34%   +0.01%     
===========================================
  Files         5392     5392              
  Lines       232584   232592       +8     
  Branches     44434    44532      +98     
===========================================
+ Hits        168230   168275      +45     
+ Misses       59816    59765      -51     
- Partials      4538     4552      +14     
Flag Coverage Δ
unit 72.16% <100.00%> (+0.01%) ⬆️

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.

This branch has not been deployed

No deployments
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.

1 participant