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

Regression: Fix issue with opening rooms #17028

Merged
merged 4 commits into from
Mar 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/lib/server/functions/createDirectRoom.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ export const createDirectRoom = function(members, roomExtraData = {}, options =

// Deprecated: using users' _id to compose the room _id is deprecated
const room = uids.length <= 2
? Rooms.findById(uids.join(''), { fields: { _id: 1 } })
: Rooms.findDirectRoomContainingAllUserIDs(uids, { fields: { _id: 1 } });
? Rooms.findOneById(uids.join(''), { fields: { _id: 1 } })
: Rooms.findOneDirectRoomContainingAllUserIDs(uids, { fields: { _id: 1 } });

const isNewRoom = !room;

Expand Down
2 changes: 1 addition & 1 deletion app/models/server/models/Rooms.js
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ export class Rooms extends Base {
return this.findOne(query, options);
}

findDirectRoomContainingAllUserIDs(uid, options) {
findOneDirectRoomContainingAllUserIDs(uid, options) {
const query = {
t: 'd',
uids: { $size: uid.length, $all: uid },
Expand Down
2 changes: 1 addition & 1 deletion app/ui-cached-collection/client/models/CachedCollection.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export class CachedCollection extends EventEmitter {
userRelated = true,
listenChangesForLoggedUsersOnly = false,
useSync = true,
version = 8,
version = 9,
maxCacheTime = 60 * 60 * 24 * 30,
onSyncData = (/* action, record */) => {},
}) {
Expand Down
6 changes: 5 additions & 1 deletion app/ui-utils/client/lib/RoomManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,11 @@ export const RoomManager = new function() {
openedRooms[typeName].ready = false;
openedRooms[typeName].active = false;
if (openedRooms[typeName].template != null) {
Blaze.remove(openedRooms[typeName].template);
try {
Blaze.remove(openedRooms[typeName].template);
} catch (e) {
console.error('Error removing template from DOM', e);
}
}
delete openedRooms[typeName].dom;
delete openedRooms[typeName].template;
Expand Down
2 changes: 1 addition & 1 deletion packages/rocketchat-i18n/i18n/en.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -1140,7 +1140,7 @@
"Desktop_Notifications_Not_Enabled": "Desktop Notifications are Not Enabled",
"Details": "Details",
"Different_Style_For_User_Mentions": "Different style for user mentions",
"Direct_message_creation_description" : "You are about to create a chat with multiple users. Add the ones you would like to talk, everyone in te same place, using direct messages.",
"Direct_message_creation_description" : "You are about to create a chat with multiple users. Add the ones you would like to talk, everyone in the same place, using direct messages.",
"Direct_message_you_have_joined": "You have joined a new direct message with",
"Direct_message_someone": "Direct message someone",
"Direct_Messages": "Direct Messages",
Expand Down