Merge branch 'edge' into meteor-1.8

This commit is contained in:
Lauri Ojansivu 2019-02-28 23:03:16 +02:00
commit 174ad1a987
12 changed files with 74 additions and 24 deletions

View file

@ -91,3 +91,4 @@ wekan:accounts-cas
wekan-scrollbar wekan-scrollbar
mquandalle:perfect-scrollbar mquandalle:perfect-scrollbar
mdg:meteor-apm-agent mdg:meteor-apm-agent
meteorhacks:unblock

View file

@ -95,6 +95,7 @@ meteorhacks:collection-utils@1.2.0
meteorhacks:meteorx@1.4.1 meteorhacks:meteorx@1.4.1
meteorhacks:picker@1.0.3 meteorhacks:picker@1.0.3
meteorhacks:subs-manager@1.6.4 meteorhacks:subs-manager@1.6.4
meteorhacks:unblock@1.1.0
meteorspark:util@0.2.0 meteorspark:util@0.2.0
minifier-css@1.4.1 minifier-css@1.4.1
minifier-js@2.4.0 minifier-js@2.4.0

View file

@ -1,3 +1,17 @@
# v2.32 2019-02-28 Wekan release
This release adds the following [performance improvements](https://github.com/wekan/wekan/pull/2214), thanks to justinr1234:
- New indexes for queries that were missing an index;
- Bulk querying documents to reduce the number of mongo queries when loading a board;
- Ensure oplog is being used to query the database by providing a `sort` key when `limit` is used querying the `boards` collection.
and fixes the following bugs related to [Template features](https://github.com/wekan/wekan/issues/2209), thanks to andresmanelli:
- [Fix filtering in swimlane view](https://github.com/wekan/wekan/commit/49229e1723de14cdc66dc6480624bba426d35e36) that was [broken since v2.29](https://github.com/wekan/wekan/issues/2213).
Thanks to above GitHub users for their contributions.
# v2.31 2019-02-28 Wekan release # v2.31 2019-02-28 Wekan release
This release fixes the following bugs related to [Template features](https://github.com/wekan/wekan/issues/2209), thanks to GitHub user andresmanelli: This release fixes the following bugs related to [Template features](https://github.com/wekan/wekan/issues/2209), thanks to GitHub user andresmanelli:

View file

@ -1,5 +1,5 @@
appId: wekan-public/apps/77b94f60-dec9-0136-304e-16ff53095928 appId: wekan-public/apps/77b94f60-dec9-0136-304e-16ff53095928
appVersion: "v2.31.0" appVersion: "v2.32.0"
files: files:
userUploads: userUploads:
- README.md - README.md

View file

@ -27,6 +27,10 @@ Attachments = new FS.Collection('attachments', {
if (Meteor.isServer) { if (Meteor.isServer) {
Meteor.startup(() => {
Attachments.files._ensureIndex({ cardId: 1 });
});
Attachments.allow({ Attachments.allow({
insert(userId, doc) { insert(userId, doc) {
return allowIsBoardMember(userId, Boards.findOne(doc.boardId)); return allowIsBoardMember(userId, Boards.findOne(doc.boardId));

View file

@ -189,6 +189,7 @@ function publishChekListUncompleted(userId, doc){
if (Meteor.isServer) { if (Meteor.isServer) {
Meteor.startup(() => { Meteor.startup(() => {
ChecklistItems._collection._ensureIndex({ checklistId: 1 }); ChecklistItems._collection._ensureIndex({ checklistId: 1 });
ChecklistItems._collection._ensureIndex({ cardId: 1 });
}); });
ChecklistItems.after.update((userId, doc, fieldNames) => { ChecklistItems.after.update((userId, doc, fieldNames) => {

View file

@ -98,9 +98,9 @@ function customFieldCreation(userId, doc){
} }
if (Meteor.isServer) { if (Meteor.isServer) {
/*Meteor.startup(() => { Meteor.startup(() => {
CustomFields._collection._ensureIndex({ boardId: 1}); CustomFields._collection._ensureIndex({ boardId: 1 });
});*/ });
CustomFields.after.insert((userId, doc) => { CustomFields.after.insert((userId, doc) => {
customFieldCreation(userId, doc); customFieldCreation(userId, doc);

View file

@ -88,6 +88,10 @@ Integrations.allow({
//INTEGRATIONS REST API //INTEGRATIONS REST API
if (Meteor.isServer) { if (Meteor.isServer) {
Meteor.startup(() => {
Integrations._collection._ensureIndex({ boardId: 1 });
});
/** /**
* @operation get_all_integrations * @operation get_all_integrations
* @summary Get all integrations in board * @summary Get all integrations in board

View file

@ -133,14 +133,14 @@ Swimlanes.helpers({
}, },
lists() { lists() {
return Lists.find(Filter.mongoSelector({ return Lists.find({
boardId: this.boardId, boardId: this.boardId,
swimlaneId: {$in: [this._id, '']}, swimlaneId: {$in: [this._id, '']},
archived: false, archived: false,
}), { sort: ['sort'] }); }, { sort: ['sort'] });
}, },
allLists() { myLists() {
return Lists.find({ swimlaneId: this._id }); return Lists.find({ swimlaneId: this._id });
}, },
@ -189,7 +189,7 @@ Swimlanes.mutations({
archive() { archive() {
if (this.isTemplateSwimlane()) { if (this.isTemplateSwimlane()) {
this.lists().forEach((list) => { this.myLists().forEach((list) => {
return list.archive(); return list.archive();
}); });
} }
@ -198,7 +198,7 @@ Swimlanes.mutations({
restore() { restore() {
if (this.isTemplateSwimlane()) { if (this.isTemplateSwimlane()) {
this.allLists().forEach((list) => { this.myLists().forEach((list) => {
return list.restore(); return list.restore();
}); });
} }

View file

@ -1,6 +1,6 @@
{ {
"name": "wekan", "name": "wekan",
"version": "v2.31.0", "version": "v2.32.0",
"description": "Open-Source kanban", "description": "Open-Source kanban",
"private": true, "private": true,
"scripts": { "scripts": {

View file

@ -22,10 +22,10 @@ const pkgdef :Spk.PackageDefinition = (
appTitle = (defaultText = "Wekan"), appTitle = (defaultText = "Wekan"),
# The name of the app as it is displayed to the user. # The name of the app as it is displayed to the user.
appVersion = 233, appVersion = 234,
# Increment this for every release. # Increment this for every release.
appMarketingVersion = (defaultText = "2.31.0~2019-02-28"), appMarketingVersion = (defaultText = "2.32.0~2019-02-28"),
# Human-readable presentation of the app version. # Human-readable presentation of the app version.
minUpgradableAppVersion = 0, minUpgradableAppVersion = 0,

View file

@ -60,6 +60,7 @@ Meteor.publish('archivedBoards', function() {
}); });
Meteor.publishRelations('board', function(boardId) { Meteor.publishRelations('board', function(boardId) {
this.unblock();
check(boardId, String); check(boardId, String);
const thisUserId = this.userId; const thisUserId = this.userId;
@ -72,7 +73,8 @@ Meteor.publishRelations('board', function(boardId) {
{ permission: 'public' }, { permission: 'public' },
{ members: { $elemMatch: { userId: this.userId, isActive: true }}}, { members: { $elemMatch: { userId: this.userId, isActive: true }}},
], ],
}, { limit: 1 }), function(boardId, board) { // Sort required to ensure oplog usage
}, { limit: 1, sort: { _id: 1 } }), function(boardId, board) {
this.cursor(Lists.find({ boardId })); this.cursor(Lists.find({ boardId }));
this.cursor(Swimlanes.find({ boardId })); this.cursor(Swimlanes.find({ boardId }));
this.cursor(Integrations.find({ boardId })); this.cursor(Integrations.find({ boardId }));
@ -99,24 +101,47 @@ Meteor.publishRelations('board', function(boardId) {
// //
// And in the meantime our code below works pretty well -- it's not even a // And in the meantime our code below works pretty well -- it's not even a
// hack! // hack!
// Gather queries and send in bulk
const cardComments = this.join(CardComments);
cardComments.selector = (_ids) => ({ cardId: _ids });
const attachments = this.join(Attachments);
attachments.selector = (_ids) => ({ cardId: _ids });
const checklists = this.join(Checklists);
checklists.selector = (_ids) => ({ cardId: _ids });
const checklistItems = this.join(ChecklistItems);
checklistItems.selector = (_ids) => ({ cardId: _ids });
const parentCards = this.join(Cards);
parentCards.selector = (_ids) => ({ parentId: _ids });
const boards = this.join(Boards);
const subCards = this.join(Cards);
this.cursor(Cards.find({ boardId }), function(cardId, card) { this.cursor(Cards.find({ boardId }), function(cardId, card) {
if (card.type === 'cardType-linkedCard') { if (card.type === 'cardType-linkedCard') {
const impCardId = card.linkedId; const impCardId = card.linkedId;
this.cursor(Cards.find({ _id: impCardId })); subCards.push(impCardId);
this.cursor(CardComments.find({ cardId: impCardId })); cardComments.push(impCardId);
this.cursor(Attachments.find({ cardId: impCardId })); attachments.push(impCardId);
this.cursor(Checklists.find({ cardId: impCardId })); checklists.push(impCardId);
this.cursor(ChecklistItems.find({ cardId: impCardId })); checklistItems.push(impCardId);
} else if (card.type === 'cardType-linkedBoard') { } else if (card.type === 'cardType-linkedBoard') {
this.cursor(Boards.find({ _id: card.linkedId})); boards.push(card.linkedId);
} }
this.cursor(CardComments.find({ cardId })); cardComments.push(cardId);
this.cursor(Attachments.find({ cardId })); attachments.push(cardId);
this.cursor(Checklists.find({ cardId })); checklists.push(cardId);
this.cursor(ChecklistItems.find({ cardId })); checklistItems.push(cardId);
this.cursor(Cards.find({ parentId: cardId })); parentCards.push(cardId);
}); });
// Send bulk queries for all found ids
subCards.send();
cardComments.send();
attachments.send();
checklists.send();
checklistItems.send();
boards.send();
if (board.members) { if (board.members) {
// Board members. This publication also includes former board members that // Board members. This publication also includes former board members that
// aren't members anymore but may have some activities attached to them in // aren't members anymore but may have some activities attached to them in