mirror of
https://github.com/wekan/wekan.git
synced 2025-04-20 12:07:11 -04:00
don't chain the presences cursor on the users cursor
This commit is contained in:
parent
7b5d08afd1
commit
be47357cd4
1 changed files with 10 additions and 5 deletions
|
@ -60,6 +60,7 @@ Meteor.publish('archivedBoards', function() {
|
|||
|
||||
Meteor.publishRelations('board', function(boardId) {
|
||||
check(boardId, String);
|
||||
const thisUserId = this.userId;
|
||||
|
||||
this.cursor(Boards.find({
|
||||
_id: boardId,
|
||||
|
@ -103,16 +104,20 @@ Meteor.publishRelations('board', function(boardId) {
|
|||
// Board members. This publication also includes former board members that
|
||||
// aren't members anymore but may have some activities attached to them in
|
||||
// the history.
|
||||
const memberIds = _.pluck(board.members, 'userId');
|
||||
|
||||
// We omit the current user because the client should already have that data,
|
||||
// and sending it triggers a subtle bug:
|
||||
// https://github.com/wefork/wekan/issues/15
|
||||
this.cursor(Users.find({
|
||||
_id: { $in: _.pluck(board.members, 'userId') },
|
||||
_id: { $in: _.without(memberIds, thisUserId)},
|
||||
}, { fields: {
|
||||
'username': 1,
|
||||
'profile.fullname': 1,
|
||||
'profile.avatarUrl': 1,
|
||||
}}), function(userId) {
|
||||
// Presence indicators
|
||||
this.cursor(presences.find({ userId }));
|
||||
});
|
||||
}}));
|
||||
|
||||
this.cursor(presences.find({ userId: { $in: memberIds } }));
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue