From a6eb9e84f19c4f4f6005e5901bad3c307648eb39 Mon Sep 17 00:00:00 2001 From: Talisson Costa Date: Mon, 9 Nov 2026 16:26:27 -0300 Subject: [PATCH] fix(Change requests): Refresh counts once an approve or publish succeeds The refresh only ran after re-reading the change request, and that promise was not returned, so a failed re-read left stale counts, a page stuck loading and no error. Contributes to #8774 Co-Authored-By: Claude Opus 5.5 --- frontend/common/stores/change-requests-store.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/frontend/common/stores/change-requests-store.js b/frontend/common/stores/change-requests-store.js index f34e6a436d19..f962748a28e8 100644 --- a/frontend/common/stores/change-requests-store.js +++ b/frontend/common/stores/change-requests-store.js @@ -25,18 +25,19 @@ const controller = { {}, ) .then(() => { - data + // The action has landed, so refresh even if re-reading the change request fails + getStore().dispatch( + changeRequestService.util.invalidateTags(['ChangeRequest']), + ) + getStore().dispatch( + featureStateService.util.invalidateTags(['FeatureState']), + ) + cb && cb() + return data .get(`${Project.api}features/workflows/change-requests/${id}/`) .then(async (res) => { store.model[id] = await transformChangeRequest(res) - cb && cb() store.loaded() - getStore().dispatch( - changeRequestService.util.invalidateTags(['ChangeRequest']), - ) - getStore().dispatch( - featureStateService.util.invalidateTags(['FeatureState']), - ) }) }) .catch((e) => API.ajaxHandler(store, e))