From d6cc26258144da49ce2d19c102886c662a8c5cfc Mon Sep 17 00:00:00 2001 From: mvdbeek Date: Fri, 17 Jun 2022 13:37:28 +0200 Subject: [PATCH] Fix possibility of requests queueing up in recursive watchHistory call You can test this manually by delaying the response in https://github.com/galaxyproject/galaxy/blob/928bb4b4622f57c1fb8d8eecbe4cc9b260e5aab0/lib/galaxy/webapps/galaxy/controllers/history.py#L999 and hitting the refresh button a bunch of times. In the network tab you'll see the requests piling up. --- client/src/store/historyStore/model/watchHistory.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/client/src/store/historyStore/model/watchHistory.js b/client/src/store/historyStore/model/watchHistory.js index dbc8ff9543f..f648cc670ff 100644 --- a/client/src/store/historyStore/model/watchHistory.js +++ b/client/src/store/historyStore/model/watchHistory.js @@ -22,6 +22,8 @@ let lastUpdateTime = null; let lastRequestDate = new Date(); export async function watchHistory() { + // "Reset" watchTimeout so we don't queue up watchHistory calls in rewatchHistory. + watchTimeout = null; // get current history const history = await getCurrentHistoryFromServer(); const historyId = history.id;