-
Notifications
You must be signed in to change notification settings - Fork 13.7k
chore: migrate DDP callers to REST endpoints (used methods with REST replacement) #40659
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
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
a781f1e
chore: migrate personalAccessTokens client callers from DDP to REST
ggazzo 574ea59
chore: migrate trivial DDP callers to REST endpoints
ggazzo eb6f682
chore: migrate complex caller-refactor DDP methods to REST
ggazzo 1f63b17
fix: address typecheck failures in REST migration
ggazzo a02f9d3
refactor: replace REST type casts with proper API mappers
ggazzo 7386484
fix: update useLoadSurroundingMessages mock for rooms.info REST
ggazzo 042fd77
fix: restore thread read-marker via readThreads DDP method
ggazzo 99c1003
revert: drop sendMessage + getReadReceipts REST migration
ggazzo d55b95d
docs: plan to migrate sendMessage + getReadReceipts to REST
ggazzo e13bf8b
Delete docs/ddp-migration-sendMessage-getReadReceipts-plan.md
ggazzo 617ef50
fix: address bot review findings
ggazzo 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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| import type { ICustomUserStatus, Serialized } from '@rocket.chat/core-typings'; | ||
|
|
||
| export const mapCustomUserStatusFromApi = ({ _updatedAt, ...status }: Serialized<ICustomUserStatus>): ICustomUserStatus => ({ | ||
| ...status, | ||
| _updatedAt: new Date(_updatedAt), | ||
| }); |
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,7 @@ | ||
| import type { IReadReceiptWithUser, Serialized } from '@rocket.chat/core-typings'; | ||
|
|
||
| export const mapReadReceiptFromApi = ({ ts, _updatedAt, ...receipt }: Serialized<IReadReceiptWithUser>): IReadReceiptWithUser => ({ | ||
| ...receipt, | ||
| ts: new Date(ts), | ||
| _updatedAt: new Date(_updatedAt), | ||
| }); |
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
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.
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.
Unreachable code: invite message will never be sent.
The condition
openedRoom === group._idcan never be true.openedRoomis captured fromuseOpenedRoom()at render time (the room open before the modal), whilegroup._idis the ID of a group that was just created in the preceding line. A newly created group cannot match a previously opened room.This appears to be a regression—the invite message is now unreachable.
Proposed fix: send the message unconditionally to the new group
roomCoordinator.openRouteLink(group.t, { rid: group._id, name: group.name }); - if (openedRoom === group._id) { - void sdk.call('sendMessage', { - _id: Random.id(), - rid: group._id, - msg: t('Apps_Game_Center_Play_Game_Together', { name }), - }); - } + void sdk.call('sendMessage', { + _id: Random.id(), + rid: group._id, + msg: t('Apps_Game_Center_Play_Game_Together', { name }), + }); onClose();If the original intent was conditional sending, please clarify the expected behavior.
🤖 Prompt for AI Agents