From 316d116cec74c7d3f155a683da55bae2c88bfb7d Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Tue, 17 Feb 2026 13:37:30 +0530 Subject: [PATCH] fix: await IndexedDB cache clear on inbox deletion --- app/javascript/dashboard/api/CacheEnabledApiClient.js | 2 +- app/javascript/dashboard/store/modules/inboxes.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/javascript/dashboard/api/CacheEnabledApiClient.js b/app/javascript/dashboard/api/CacheEnabledApiClient.js index cf61436f1..3d90adc8b 100644 --- a/app/javascript/dashboard/api/CacheEnabledApiClient.js +++ b/app/javascript/dashboard/api/CacheEnabledApiClient.js @@ -87,7 +87,7 @@ class CacheEnabledApiClient extends ApiClient { async clearDataInCache() { try { await this.dataManager.initDb(); - this.dataManager.db.clear(this.cacheModelName); + await this.dataManager.db.clear(this.cacheModelName); } catch { // Ignore error } diff --git a/app/javascript/dashboard/store/modules/inboxes.js b/app/javascript/dashboard/store/modules/inboxes.js index 2ebbb4da9..8252aa416 100644 --- a/app/javascript/dashboard/store/modules/inboxes.js +++ b/app/javascript/dashboard/store/modules/inboxes.js @@ -325,7 +325,7 @@ export const actions = { await InboxesAPI.delete(inboxId); commit(types.default.DELETE_INBOXES, inboxId); // Clear IndexedDB so stale inbox data isn't served on page refresh - InboxesAPI.clearDataInCache(); + await InboxesAPI.clearDataInCache(); commit(types.default.SET_INBOXES_UI_FLAG, { isDeleting: false }); } catch (error) { commit(types.default.SET_INBOXES_UI_FLAG, { isDeleting: false });