Skip to content
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

chore: Remove starMessage client meteor method #33817

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

yash-rajpal
Copy link
Member

@yash-rajpal yash-rajpal commented Oct 28, 2024

Proposed changes (including videos or screenshots)

Issue(s)

Steps to test or reproduce

Further comments

ARCH-1344

Copy link
Contributor

dionisio-bot bot commented Oct 28, 2024

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

Copy link

changeset-bot bot commented Oct 28, 2024

🦋 Changeset detected

Latest commit: 5cd1e97

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

This PR includes changesets to release 35 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/livechat Patch
@rocket.chat/model-typings Patch
@rocket.chat/ui-contexts 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/network-broker Patch
@rocket.chat/models Patch
@rocket.chat/ui-avatar Patch
@rocket.chat/ui-client Patch
@rocket.chat/ui-video-conf Patch
@rocket.chat/ui-voip Patch
@rocket.chat/web-ui-registration Patch
@rocket.chat/instance-status 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

Copy link
Contributor

PR Preview Action v1.4.8
🚀 Deployed preview to https://RocketChat.github.io/Rocket.Chat/pr-preview/pr-33817/
on branch gh-pages at 2024-10-28 22:18 UTC

@yash-rajpal yash-rajpal marked this pull request as ready for review October 28, 2024 22:23
@yash-rajpal yash-rajpal requested a review from a team as a code owner October 28, 2024 22:23
@@ -19,7 +20,8 @@ Meteor.startup(() => {
const { message = messageArgs(this).msg } = props;

try {
await sdk.call('starMessage', { ...message, starred: true });
await sdk.rest.post('/v1/chat.starMessage', { messageId: message._id });
starMessage(message, true);
Copy link
Contributor

Choose a reason for hiding this comment

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

What will happen if starMessage() fails and throws and error? Shouldn't ['rooms', message.rid, 'starred-messages'] queries be invalidated regardless of this?

Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe we should put this query invalidation in a finally block, since it should happen regardless of try or catch block.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done as suggested above.

@tassoevan tassoevan added this to the 7.1.0 milestone Oct 29, 2024
'@rocket.chat/meteor': patch
---

Remove client side `starMessage` meteor method and replace this meteor method call with rest API.
Copy link
Member

@debdutdeb debdutdeb Oct 31, 2024

Choose a reason for hiding this comment

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

Suggested change
Remove client side `starMessage` meteor method and replace this meteor method call with rest API.
Removes client side `starMessage` meteor method and replaces this meteor method call with rest API.

But, I kinda think these changesets are not needed.

Or, more likely replace with something much much more generic, Reduces websocket overhead from web client.

given these are for customers, and not considered to be breaking, they do seem out of place in terms of friendliness and customer facing-ness (if that's a word);

Comment on lines +9 to +10
export const starMessage = (message: IMessage, starred: boolean) => {
const uid = Meteor.userId();
Copy link
Member

Choose a reason for hiding this comment

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

if this is a new function, shouldn't we be able to just pass the uid instead of depending on meteor?

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