From f9ebf800741e9adf1cb9a4733a2d1697b1178c8b Mon Sep 17 00:00:00 2001 From: mrsimpson Date: Wed, 14 Aug 2019 13:21:54 +0200 Subject: [PATCH 1/3] Limit resynched messages to last 10 messages --- app/assistify/ai/server/lib/SmartiAdapter.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/assistify/ai/server/lib/SmartiAdapter.js b/app/assistify/ai/server/lib/SmartiAdapter.js index 447257a03b7d..7eab09c4e626 100644 --- a/app/assistify/ai/server/lib/SmartiAdapter.js +++ b/app/assistify/ai/server/lib/SmartiAdapter.js @@ -412,8 +412,8 @@ export class SmartiAdapter { try { SystemLogger.debug('Sync messages for room: ', roomId); - const limit = parseInt(settings.get('Assistify_AI_Resync_Message_Limit')) || 1000; - const messageFindOptions = { sort: { ts: 1 }, limit }; + const limit = parseInt(settings.get('Assistify_AI_Resync_Message_Limit')) || 10; + const messageFindOptions = { sort: { ts: -1 }, limit }; // only resync rooms containing outdated messages, if a delta sync is requested if (!ignoreSyncFlag || ignoreSyncFlag !== true) { @@ -424,7 +424,7 @@ export class SmartiAdapter { return true; } - SystemLogger.debug('Messages out of sync: ', unsync.length); + SystemLogger.debug('Messages out of sync: ', unsync); } // delete convervation from Smarti, if already exists From d66ebad4ceef599fa20290706322f3a090232906 Mon Sep 17 00:00:00 2001 From: mrsimpson Date: Wed, 14 Aug 2019 13:34:34 +0200 Subject: [PATCH 2/3] Disable implicit resync to Smarti onMessage --- app/assistify/ai/server/lib/SmartiAdapter.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/assistify/ai/server/lib/SmartiAdapter.js b/app/assistify/ai/server/lib/SmartiAdapter.js index 7eab09c4e626..2e1cc7897ee9 100644 --- a/app/assistify/ai/server/lib/SmartiAdapter.js +++ b/app/assistify/ai/server/lib/SmartiAdapter.js @@ -122,7 +122,14 @@ export class SmartiAdapter { Meteor.defer(() => SmartiAdapter._markMessageAsSynced(message._id)); notifyClientsSmartiDirty(message.rid, conversationId); // autosync: If a room was not in sync, but the new message could be synced, try to sync the room again + + /* + Remove autosync after a message is sent due to negative side effects: + In the course of marking a messages synced, an update on a message is performed. + This makes the UI load the updated message. + Depending on the message count resynced, this can have a severe impact on client performance Meteor.defer(() => SmartiAdapter._tryResync(message.rid, false)); + */ } else { // if the message could not be synced this time, re-synch the complete room next time Meteor.defer(() => SmartiAdapter._markRoomAsUnsynced(message.rid)); From ae7f039d02623abf84e5e9ecd1048cdec59fb2aa Mon Sep 17 00:00:00 2001 From: mrsimpson Date: Wed, 14 Aug 2019 14:18:03 +0200 Subject: [PATCH 3/3] Bump version to 1.1.3- 0.9.11 --- HISTORY.md | 7 +++++++ app/utils/rocketchat.info | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/HISTORY.md b/HISTORY.md index 592ef74455b3..899165de8707 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,3 +1,10 @@ +# Assistify 0.9.11 + +This release fixes a severe bug 🐛 with respect to frontend performance: +In large rooms, new messages triggered the loading of many previous messages which in turn increased memory, made the scolling jump and led the UI non-responsive in the worst case to to a re-calculation of mention marks. + +Now, messages are not re-synced implicitly to Smarti anymore, removing the trigger for the message reloading. + # Assistify 0.9.10 This Release bumps Rocket.Chat to 1.1.3 diff --git a/app/utils/rocketchat.info b/app/utils/rocketchat.info index dfcdf4ff7eca..c9d9171d8f2f 100644 --- a/app/utils/rocketchat.info +++ b/app/utils/rocketchat.info @@ -1,3 +1,3 @@ { - "version": "1.1.3-0.9.10" + "version": "1.1.3-0.9.11" }