mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Always pass update_time cursor on SSE-driven history refresh
When SSE fires and refreshHistoryFromPush runs with force=true, we were passing undefined to loadCurrentHistory, refetching the history summary without the server-side `since` cursor. Always pass lastUpdateTime so the server can short-circuit when nothing changed; force=true now only bypasses the client-side `lastUpdateTime >= history.update_time` gate, not the cursor — items the client already has are not refetched.
This commit is contained in:
@@ -58,8 +58,11 @@ async function _fetchHistoryAndChangedItems(app, { force }) {
|
||||
const collectionElementsStore = useCollectionElementsStore();
|
||||
|
||||
const checkForUpdate = new Date();
|
||||
// When forced, skip the `since` filter so the server always returns the history.
|
||||
const history = await historyStore.loadCurrentHistory(force ? undefined : lastUpdateTime);
|
||||
// Always pass the `since` cursor so the server can short-circuit cheaply
|
||||
// when nothing has changed; SSE-driven `force` only bypasses the
|
||||
// client-side update_time equality gate, not the server-side cursor —
|
||||
// we don't want to refetch items the client already has.
|
||||
const history = await historyStore.loadCurrentHistory(lastUpdateTime);
|
||||
const { lastCheckedTime } = storeToRefs(historyItemsStore);
|
||||
lastCheckedTime.value = checkForUpdate;
|
||||
if (!history || !history.id) {
|
||||
|
||||
Reference in New Issue
Block a user