From 82d98b8ff1895038b884c16f3e4aee3f894c71ce Mon Sep 17 00:00:00 2001 From: Jonathan Prusik Date: Fri, 17 May 2024 15:00:37 -0400 Subject: [PATCH] defer badge and menu state updates (#9223) --- apps/browser/src/background/runtime.background.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/apps/browser/src/background/runtime.background.ts b/apps/browser/src/background/runtime.background.ts index 1db32659d2..5473664e3b 100644 --- a/apps/browser/src/background/runtime.background.ts +++ b/apps/browser/src/background/runtime.background.ts @@ -196,8 +196,6 @@ export default class RuntimeBackground { } await this.notificationsService.updateConnection(msg.command === "loggedIn"); - await this.main.refreshBadge(); - await this.main.refreshMenu(false); this.systemService.cancelProcessReload(); if (item) { @@ -209,6 +207,13 @@ export default class RuntimeBackground { item, ); } + + // @TODO these need to happen last to avoid blocking `tabSendMessageData` above + // The underlying cause exists within `cipherService.getAllDecrypted` via + // `getAllDecryptedForUrl` and is anticipated to be refactored + await this.main.refreshBadge(); + await this.main.refreshMenu(false); + break; } case "addToLockedVaultPendingNotifications":