From b9346fe6ea8c31c688d3de86a3e5b5d0052a4fcb Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Wed, 13 Oct 2021 22:01:30 -0700 Subject: [PATCH] fix: Minor collab adjusts --- server/collaboration/tracing.js | 3 ++- server/commands/documentUpdater.js | 2 -- server/queues/processors/debouncer.js | 4 +++- shared/i18n/locales/en_US/translation.json | 3 +++ 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/server/collaboration/tracing.js b/server/collaboration/tracing.js index 51bcfde5..f6ce2eb2 100644 --- a/server/collaboration/tracing.js +++ b/server/collaboration/tracing.js @@ -50,7 +50,8 @@ export default class Tracing { Metrics.gaugePerInstance( "collaboration.documents_count", - instance.getDocumentsCount() + // -1 adjustment because hook is called before document is removed + instance.getDocumentsCount() - 1 ); } diff --git a/server/commands/documentUpdater.js b/server/commands/documentUpdater.js index f38bc0c5..72de0acc 100644 --- a/server/commands/documentUpdater.js +++ b/server/commands/documentUpdater.js @@ -10,12 +10,10 @@ export default async function documentUpdater({ documentId, ydoc, userId, - done, }: { documentId: string, ydoc: Y.Doc, userId: string, - done?: boolean, }) { const document = await Document.findByPk(documentId); const state = Y.encodeStateAsUpdate(ydoc); diff --git a/server/queues/processors/debouncer.js b/server/queues/processors/debouncer.js index 524590c4..76227c87 100644 --- a/server/queues/processors/debouncer.js +++ b/server/queues/processors/debouncer.js @@ -19,7 +19,9 @@ export default class DebounceProcessor { break; } case "documents.update.delayed": { - const document = await Document.findByPk(event.documentId); + const document = await Document.findByPk(event.documentId, { + fields: ["updatedAt"], + }); // If the document has been deleted then prevent further processing if (!document) return; diff --git a/shared/i18n/locales/en_US/translation.json b/shared/i18n/locales/en_US/translation.json index 661d221b..340928f9 100644 --- a/shared/i18n/locales/en_US/translation.json +++ b/shared/i18n/locales/en_US/translation.json @@ -284,6 +284,7 @@ "You can edit the name and other details at any time, however doing so often might confuse your team mates.": "You can edit the name and other details at any time, however doing so often might confuse your team mates.", "Name": "Name", "Alphabetical": "Alphabetical", + "Sort": "Sort", "Saving": "Saving", "Save": "Save", "Export started, you will receive an email when it’s complete.": "Export started, you will receive an email when it’s complete.", @@ -350,6 +351,8 @@ "Hide contents": "Hide contents", "Show contents": "Show contents", "Edit {{noun}}": "Edit {{noun}}", + "Switch to dark": "Switch to dark", + "Switch to light": "Switch to light", "Archived": "Archived", "Save Draft": "Save Draft", "Done Editing": "Done Editing",