Skip to content

Conversation

@aleksandernsilva
Copy link
Contributor

@aleksandernsilva aleksandernsilva commented Nov 17, 2025

Proposed changes (including videos or screenshots)

This PR's disables read receipts for federated rooms. This feature will be re-introduced to federated rooms when the capability becomes fully compatible with Federation.

Issue(s)

FB-45
FB-75

Steps to test or reproduce

Further comments

Summary by CodeRabbit

  • Bug Fixes

    • Read receipts indicators are now disabled in federated rooms.
  • Tests

    • Added unit tests for read receipts functionality, including configuration and display behavior across different feature flag states.

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

@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Nov 17, 2025

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

  • This PR is missing the 'stat: QA assured' label

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 17, 2025

🦋 Changeset detected

Latest commit: 01c2166

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

This PR includes changesets to release 41 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/federation-matrix Patch
@rocket.chat/license Patch
@rocket.chat/media-calls 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 Nov 17, 2025

Walkthrough

This pull request implements read receipt suppression in federated rooms by extracting the MessageListContext default value into a named constant, adding unit tests for read receipt features, and modifying the MessageListProvider to conditionally disable read receipts when a room is federated.

Changes

Cohort / File(s) Summary
Changeset
.changeset/cold-chefs-rhyme.md
Documents patch for disabling read receipt indicators in federated rooms.
Context and Utilities
apps/meteor/client/components/message/list/MessageListContext.tsx
Extracts MessageListContext default value into a named exported constant messageListContextDefaultValue for improved reusability and testability.
Read Receipts Logic
apps/meteor/client/views/room/MessageList/providers/MessageListProvider.tsx
Disables read receipts in federated rooms by adding isRoomFederated(room) check to the readReceiptsEnabled condition.
Unit Tests
apps/meteor/client/components/message/toolbar/useReadReceiptsDetailsAction.spec.tsx, apps/meteor/client/components/message/variants/RoomMessage.spec.tsx
Adds test coverage for read receipt feature behavior with mocked MessageListContext to verify correct handling when read receipts are enabled/disabled and in federated contexts.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

  • Verify the isRoomFederated() utility correctly identifies federated rooms
  • Confirm test mocks accurately reflect the MessageListContext behavior and cover federated room scenarios
  • Ensure the extracted messageListContextDefaultValue constant doesn't break existing component consumers

Suggested labels

stat: ready to merge, stat: QA assured

Suggested reviewers

  • ggazzo
  • rodrigok
  • sampaiodiego

Poem

🐰 A rabbit hops through federated rooms,
Where read receipts bloom and gloom,
But now they're gone—tests pass with cheer,
Until federation's crystal clear! ✨

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: disabling message read receipts in federated rooms, which is the core focus of all modifications.
Linked Issues check ✅ Passed Changes address FB-45 and FB-75 by disabling read receipts in federated rooms via context-based conditional logic and test coverage for the feature flag behavior.
Out of Scope Changes check ✅ Passed All changes are directly scoped to read receipts suppression in federated rooms: context extraction, federated room checks, and related test coverage.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ 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/disable-read-receipts-federation

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.

@aleksandernsilva aleksandernsilva changed the title chore: Disable read receipts on federated rooms chore: Disable message read receipts on federated rooms Nov 17, 2025
@aleksandernsilva aleksandernsilva changed the title chore: Disable message read receipts on federated rooms chore: Disable message read receipts in federated rooms Nov 17, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Nov 17, 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 -3.1KiB
queue-worker-service 132MiB 132MiB -26B
ddp-streamer-service 126MiB 126MiB +312B
account-service 113MiB 113MiB -2.0KiB
stream-hub-service 111MiB 111MiB -831B
authorization-service 111MiB 111MiB -150B
presence-service 111MiB 111MiB +153B

📊 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/08 16:42", "12/08 18:03 (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]
  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]
  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]
  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, 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, 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, 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.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, 0.11]
Loading

Statistics (last 15 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-37534
  • Baseline: develop
  • Timestamp: 2025-12-08 18:03:01 UTC
  • Historical data points: 15

Updated: Mon, 08 Dec 2025 18:03:02 GMT

@codecov
Copy link

codecov bot commented Nov 17, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.80%. Comparing base (d0be8ad) to head (01c2166).
⚠️ Report is 9 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #37534      +/-   ##
===========================================
+ Coverage    67.78%   67.80%   +0.02%     
===========================================
  Files         3449     3449              
  Lines       113987   113972      -15     
  Branches     20956    20956              
===========================================
+ Hits         77262    77279      +17     
+ Misses       34610    34576      -34     
- Partials      2115     2117       +2     
Flag Coverage Δ
e2e 57.32% <100.00%> (+0.09%) ⬆️
e2e-api 42.15% <ø> (-0.04%) ⬇️

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.

@aleksandernsilva
Copy link
Contributor Author

@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 8, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@aleksandernsilva aleksandernsilva force-pushed the chore/disable-read-receipts-federation branch from 567d1ac to 58e3a16 Compare December 8, 2025 13:29
@ggazzo ggazzo added this to the 7.14.0 milestone Dec 8, 2025
@aleksandernsilva aleksandernsilva force-pushed the chore/disable-read-receipts-federation branch from 71892f1 to 7e7aa19 Compare December 8, 2025 17:46
@aleksandernsilva aleksandernsilva force-pushed the chore/disable-read-receipts-federation branch from 7e7aa19 to 01c2166 Compare December 8, 2025 17:48
@aleksandernsilva aleksandernsilva marked this pull request as ready for review December 8, 2025 23:13
@aleksandernsilva aleksandernsilva requested a review from a team as a code owner December 8, 2025 23:13
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: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between b315fba and 01c2166.

📒 Files selected for processing (5)
  • .changeset/cold-chefs-rhyme.md (1 hunks)
  • apps/meteor/client/components/message/list/MessageListContext.tsx (2 hunks)
  • apps/meteor/client/components/message/toolbar/useReadReceiptsDetailsAction.spec.tsx (1 hunks)
  • apps/meteor/client/components/message/variants/RoomMessage.spec.tsx (2 hunks)
  • apps/meteor/client/views/room/MessageList/providers/MessageListProvider.tsx (2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation

Files:

  • apps/meteor/client/components/message/toolbar/useReadReceiptsDetailsAction.spec.tsx
  • apps/meteor/client/views/room/MessageList/providers/MessageListProvider.tsx
  • apps/meteor/client/components/message/variants/RoomMessage.spec.tsx
  • apps/meteor/client/components/message/list/MessageListContext.tsx
🧠 Learnings (11)
📓 Common learnings
Learnt from: ricardogarim
Repo: RocketChat/Rocket.Chat PR: 37377
File: apps/meteor/ee/server/hooks/federation/index.ts:86-88
Timestamp: 2025-11-04T16:49:19.107Z
Learning: In Rocket.Chat's federation system (apps/meteor/ee/server/hooks/federation/), permission checks follow two distinct patterns: (1) User-initiated federation actions (creating rooms, adding users to federated rooms, joining from invites) should throw MeteorError to inform users they lack 'access-federation' permission. (2) Remote server-initiated federation events should silently skip/ignore when users lack permission. The beforeAddUserToRoom hook only executes for local user-initiated actions, so throwing an error there is correct. Remote federation events are handled separately by the federation Matrix package with silent skipping logic.
Learnt from: MartinSchoeler
Repo: RocketChat/Rocket.Chat PR: 37408
File: apps/meteor/client/views/admin/ABAC/useRoomAttributeOptions.tsx:53-69
Timestamp: 2025-11-10T19:06:20.146Z
Learning: In the Rocket.Chat repository, do not provide suggestions or recommendations about code sections marked with TODO comments. The maintainers have already identified these as future work and external reviewers lack the full context about implementation plans and timing.
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Utilize Playwright fixtures (`test`, `page`, `expect`) for consistency in test files

Applied to files:

  • apps/meteor/client/components/message/toolbar/useReadReceiptsDetailsAction.spec.tsx
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Use `expect` matchers for assertions (`toEqual`, `toContain`, `toBeTruthy`, `toHaveLength`, etc.) instead of `assert` statements in Playwright tests

Applied to files:

  • apps/meteor/client/components/message/toolbar/useReadReceiptsDetailsAction.spec.tsx
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Use `test.step()` for complex test scenarios to improve organization in Playwright tests

Applied to files:

  • apps/meteor/client/components/message/toolbar/useReadReceiptsDetailsAction.spec.tsx
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Group related tests in the same file

Applied to files:

  • apps/meteor/client/components/message/toolbar/useReadReceiptsDetailsAction.spec.tsx
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Maintain test isolation between test cases in Playwright tests

Applied to files:

  • apps/meteor/client/components/message/toolbar/useReadReceiptsDetailsAction.spec.tsx
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Prefer web-first assertions (`toBeVisible`, `toHaveText`, etc.) in Playwright tests

Applied to files:

  • apps/meteor/client/components/message/toolbar/useReadReceiptsDetailsAction.spec.tsx
📚 Learning: 2025-11-24T17:08:17.065Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat PR: 0
File: .cursor/rules/playwright.mdc:0-0
Timestamp: 2025-11-24T17:08:17.065Z
Learning: Applies to apps/meteor/tests/e2e/**/*.spec.ts : Ensure tests run reliably in parallel without shared state conflicts

Applied to files:

  • apps/meteor/client/components/message/toolbar/useReadReceiptsDetailsAction.spec.tsx
📚 Learning: 2025-10-28T16:53:42.761Z
Learnt from: ricardogarim
Repo: RocketChat/Rocket.Chat PR: 37205
File: ee/packages/federation-matrix/src/FederationMatrix.ts:296-301
Timestamp: 2025-10-28T16:53:42.761Z
Learning: In the Rocket.Chat federation-matrix integration (ee/packages/federation-matrix/), the createRoom method from rocket.chat/federation-sdk will support a 4-argument signature (userId, roomName, visibility, displayName) in newer versions. Code using this 4-argument call is forward-compatible with planned library updates and should not be flagged as an error.

Applied to files:

  • apps/meteor/client/views/room/MessageList/providers/MessageListProvider.tsx
  • .changeset/cold-chefs-rhyme.md
📚 Learning: 2025-09-19T15:15:04.642Z
Learnt from: rodrigok
Repo: RocketChat/Rocket.Chat PR: 36991
File: apps/meteor/server/services/federation/infrastructure/rocket-chat/adapters/Settings.ts:219-221
Timestamp: 2025-09-19T15:15:04.642Z
Learning: The Federation_Matrix_homeserver_domain setting in apps/meteor/server/services/federation/infrastructure/rocket-chat/adapters/Settings.ts is part of the old federation system and is being deprecated/removed, so configuration issues with this setting should not be flagged for improvement.

Applied to files:

  • apps/meteor/client/views/room/MessageList/providers/MessageListProvider.tsx
  • .changeset/cold-chefs-rhyme.md
📚 Learning: 2025-11-04T16:49:19.107Z
Learnt from: ricardogarim
Repo: RocketChat/Rocket.Chat PR: 37377
File: apps/meteor/ee/server/hooks/federation/index.ts:86-88
Timestamp: 2025-11-04T16:49:19.107Z
Learning: In Rocket.Chat's federation system (apps/meteor/ee/server/hooks/federation/), permission checks follow two distinct patterns: (1) User-initiated federation actions (creating rooms, adding users to federated rooms, joining from invites) should throw MeteorError to inform users they lack 'access-federation' permission. (2) Remote server-initiated federation events should silently skip/ignore when users lack permission. The beforeAddUserToRoom hook only executes for local user-initiated actions, so throwing an error there is correct. Remote federation events are handled separately by the federation Matrix package with silent skipping logic.

Applied to files:

  • apps/meteor/client/views/room/MessageList/providers/MessageListProvider.tsx
  • .changeset/cold-chefs-rhyme.md
🧬 Code graph analysis (3)
apps/meteor/client/components/message/toolbar/useReadReceiptsDetailsAction.spec.tsx (3)
apps/meteor/client/components/message/list/MessageListContext.tsx (1)
  • useMessageListReadReceipts (107-107)
apps/meteor/tests/mocks/data.ts (1)
  • createFakeMessage (93-108)
apps/meteor/client/components/message/toolbar/useReadReceiptsDetailsAction.tsx (1)
  • useReadReceiptsDetailsAction (8-36)
apps/meteor/client/views/room/MessageList/providers/MessageListProvider.tsx (1)
packages/core-typings/src/IRoom.ts (1)
  • isRoomFederated (122-122)
apps/meteor/client/components/message/variants/RoomMessage.spec.tsx (2)
packages/mock-providers/src/index.ts (1)
  • mockAppRoot (3-3)
apps/meteor/client/components/message/list/MessageListContext.tsx (2)
  • MessageListContext (79-79)
  • messageListContextDefaultValue (48-77)
🔇 Additional comments (4)
.changeset/cold-chefs-rhyme.md (1)

1-5: LGTM!

The changeset clearly documents the change and provides context about re-enabling the feature when federation compatibility is achieved.

apps/meteor/client/components/message/list/MessageListContext.tsx (1)

48-79: LGTM! Clean refactor that improves testability.

Extracting the default value into a named constant makes it reusable in test files, enabling cleaner test setup and assertions. The refactor maintains type safety and doesn't alter runtime behavior.

apps/meteor/client/components/message/variants/RoomMessage.spec.tsx (1)

111-159: LGTM! Comprehensive test coverage for read receipts.

The tests properly verify that read receipt indicators are shown when enabled and hidden when disabled, using clean context provider wrapping to control feature flags.

apps/meteor/client/components/message/toolbar/useReadReceiptsDetailsAction.spec.tsx (1)

1-50: LGTM! Thorough unit test coverage.

The tests comprehensively cover all branches of useReadReceiptsDetailsAction: returning null when read receipts are disabled, returning null when store users is disabled, and returning the expected action config when both are enabled. Clean mocking and proper test isolation.


const autoLinkDomains = useSetting('Message_CustomDomain_AutoLink', '');
const readReceiptsEnabled = useSetting('Message_Read_Receipt_Enabled', false);
const readReceiptsEnabled = useSetting('Message_Read_Receipt_Enabled', false) && !isRoomFederated(room);
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

# Search for read receipt processing in server-side code
rg -n "read.*receipt|receipt.*read" --type=ts --glob='**/server/**' -A 5 -B 2 | head -150

Repository: RocketChat/Rocket.Chat

Length of output: 9652


🏁 Script executed:

# Search for federated room checks in read receipt context
rg -n "readReceipt|read_receipt" --type=ts --glob='**/server/**' | head -100

Repository: RocketChat/Rocket.Chat

Length of output: 1056


🏁 Script executed:

# Search for isRoomFederated usage in server code
rg -n "isRoomFederated" --type=ts --glob='**/server/**' | head -50

Repository: RocketChat/Rocket.Chat

Length of output: 3075


🏁 Script executed:

# Look for read receipt hooks or handlers
rg -n "beforeSetUserStatus|beforeUpdateUserStatusAndRoom|Meteor.methods.*receipt" --type=ts --glob='**/server/**' -A 3 | head -100

Repository: RocketChat/Rocket.Chat

Length of output: 48


🏁 Script executed:

cat -n apps/meteor/ee/app/message-read-receipt/server/hooks/afterReadMessages.ts

Repository: RocketChat/Rocket.Chat

Length of output: 1056


🏁 Script executed:

cat -n apps/meteor/ee/app/message-read-receipt/server/hooks/afterSaveMessage.ts

Repository: RocketChat/Rocket.Chat

Length of output: 804


🏁 Script executed:

cat -n apps/meteor/ee/server/lib/message-read-receipt/ReadReceipt.ts | head -200

Repository: RocketChat/Rocket.Chat

Length of output: 6406


Backend read receipt processing must also be blocked for federated rooms.

The UI change correctly disables read receipt indicators in federated rooms, but backend processing continues unaddressed. The read receipt hooks (afterReadMessages and afterSaveMessage) and the ReadReceipt class methods (markMessagesAsRead, markMessageAsReadBySender, storeThreadMessagesReadReceipts) lack any federated room checks. This causes read receipt data to be stored in the database for federated rooms despite being hidden in the UI, creating data inconsistencies.

Add isRoomFederated checks to these backend methods to prevent unnecessary read receipt storage and processing for federated rooms.

🤖 Prompt for AI Agents
In apps/meteor/client/views/room/MessageList/providers/MessageListProvider.tsx
around line 43 and in the backend read-receipt code (the afterReadMessages and
afterSaveMessage hooks and the ReadReceipt class methods markMessagesAsRead,
markMessageAsReadBySender, and storeThreadMessagesReadReceipts), the backend
still processes and stores read receipts for federated rooms; update each
backend entrypoint to call isRoomFederated(room) early and skip processing
(return/do nothing) when it returns true, ensuring you import or reference the
same isRoomFederated utility and pass the proper room object so no read receipt
DB writes or further processing occur for federated rooms.

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.

3 participants