-
Notifications
You must be signed in to change notification settings - Fork 10.9k
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
Regression: sidebar sorting was being wrong in some cases where the rooms records were returned before the subscriptions #11273
Conversation
const sub = RocketChat.models.Subscriptions.findOne({ rid: room._id }); | ||
if (!sub) { | ||
return; | ||
return room; |
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.
Why return something?
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.
actually there are no difference (callbacks use the last value returned !== undefined, just to avoid some misunderstanding.
const sub = RocketChat.models.Subscriptions.findOne({ rid: room._id }); | ||
if (!sub) { | ||
return; | ||
return room; | ||
} | ||
const $set = {lastMessage : room.lastMessage, lm: room._updatedAt, ...getLowerCaseNames(room, sub.name)}; |
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.
Please break this object in multiple lines and remove the space before the first colon.
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.
I'm ok with the spaces (our linter could help with that) but I dont like create a tabbed simple querys =/
const sub = RocketChat.models.Subscriptions.findOne({ rid: room._id }); | ||
if (!sub) { | ||
return; | ||
return room; | ||
} | ||
const $set = {lastMessage : room.lastMessage, lm: room._updatedAt, ...getLowerCaseNames(room, sub.name)}; | ||
RocketChat.models.Subscriptions.update({ rid: room._id }, {$set}); |
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.
Why not declare the set here instead of have a variable and pass it here?
server/stream/mq.js
Outdated
@@ -0,0 +1,5 @@ | |||
import redisMq from 'mqemitter-redis'; |
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.
Please remove this changes
Closes #ISSUE_NUMBER