-
Notifications
You must be signed in to change notification settings - Fork 13.1k
chore: Disable message read receipts in federated rooms #37534
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
ggazzo
merged 5 commits into
chore/disable-read-receipt
from
chore/disable-read-receipts-federation
Dec 10, 2025
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
8dd9869
fix: disabled read recepts for federated rooms
aleksandernsilva 7f65b9a
fix: showing read receipts details for federated messages
aleksandernsilva f11927b
chore: changeset
aleksandernsilva e6ef1fa
chore: disable read receipts for federated rooms
ggazzo 1abcda3
refactor: removed message checks in favor of provider check
aleksandernsilva File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@rocket.chat/meteor": patch | ||
| --- | ||
|
|
||
| Disables read receipts indicators in federated rooms. This feature will be re-enabled when fully compatible with federation. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
apps/meteor/client/components/message/toolbar/useReadReceiptsDetailsAction.spec.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| import { mockAppRoot } from '@rocket.chat/mock-providers'; | ||
| import { renderHook } from '@testing-library/react'; | ||
|
|
||
| import { useReadReceiptsDetailsAction } from './useReadReceiptsDetailsAction'; | ||
| import { createFakeMessage } from '../../../../tests/mocks/data'; | ||
| import { useMessageListReadReceipts } from '../list/MessageListContext'; | ||
|
|
||
| jest.mock('../list/MessageListContext', () => ({ | ||
| useMessageListReadReceipts: jest.fn(), | ||
| })); | ||
|
|
||
| const useMessageListReadReceiptsMocked = jest.mocked(useMessageListReadReceipts); | ||
|
|
||
| describe('useReadReceiptsDetailsAction', () => { | ||
| const message = createFakeMessage({ _id: 'messageId' }); | ||
|
|
||
| afterEach(() => { | ||
| jest.clearAllMocks(); | ||
| }); | ||
|
|
||
| it('should return null if read receipts are not enabled', () => { | ||
| useMessageListReadReceiptsMocked.mockReturnValue({ enabled: false, storeUsers: true }); | ||
|
|
||
| const { result } = renderHook(() => useReadReceiptsDetailsAction(message), { wrapper: mockAppRoot().build() }); | ||
|
|
||
| expect(result.current).toBeNull(); | ||
| }); | ||
|
|
||
| it('should return null if read receipts store users is not enabled', () => { | ||
| useMessageListReadReceiptsMocked.mockReturnValue({ enabled: true, storeUsers: false }); | ||
|
|
||
| const { result } = renderHook(() => useReadReceiptsDetailsAction(message), { wrapper: mockAppRoot().build() }); | ||
|
|
||
| expect(result.current).toBeNull(); | ||
| }); | ||
|
|
||
| it('should return a message action config', () => { | ||
| useMessageListReadReceiptsMocked.mockReturnValue({ enabled: true, storeUsers: true }); | ||
|
|
||
| const { result } = renderHook(() => useReadReceiptsDetailsAction(message), { wrapper: mockAppRoot().build() }); | ||
|
|
||
| expect(result.current).toEqual( | ||
| expect.objectContaining({ | ||
| id: 'receipt-detail', | ||
| icon: 'check-double', | ||
| label: 'Read_Receipts', | ||
| }), | ||
| ); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: RocketChat/Rocket.Chat
Length of output: 9652
🏁 Script executed:
Repository: RocketChat/Rocket.Chat
Length of output: 1056
🏁 Script executed:
Repository: RocketChat/Rocket.Chat
Length of output: 3075
🏁 Script executed:
Repository: RocketChat/Rocket.Chat
Length of output: 48
🏁 Script executed:
Repository: RocketChat/Rocket.Chat
Length of output: 1056
🏁 Script executed:
Repository: RocketChat/Rocket.Chat
Length of output: 804
🏁 Script executed:
cat -n apps/meteor/ee/server/lib/message-read-receipt/ReadReceipt.ts | head -200Repository: 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 (
afterReadMessagesandafterSaveMessage) and theReadReceiptclass 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
isRoomFederatedchecks to these backend methods to prevent unnecessary read receipt storage and processing for federated rooms.🤖 Prompt for AI Agents