From d769ec48dd0f525b6aac45c7d97bdabc4ae141e1 Mon Sep 17 00:00:00 2001 From: "D. Berge" Date: Thu, 7 Aug 2025 10:40:23 +0200 Subject: [PATCH] Request fresh responses when refreshing data from the server --- lib/www/client/source/src/store/modules/event/actions.js | 1 + lib/www/client/source/src/store/modules/label/actions.js | 1 + lib/www/client/source/src/store/modules/line/actions.js | 1 + lib/www/client/source/src/store/modules/plan/actions.js | 1 + lib/www/client/source/src/store/modules/project/actions.js | 1 + lib/www/client/source/src/store/modules/projects/actions.js | 1 + lib/www/client/source/src/store/modules/sequence/actions.js | 1 + 7 files changed, 7 insertions(+) diff --git a/lib/www/client/source/src/store/modules/event/actions.js b/lib/www/client/source/src/store/modules/event/actions.js index 8a748ce..e49d763 100644 --- a/lib/www/client/source/src/store/modules/event/actions.js +++ b/lib/www/client/source/src/store/modules/event/actions.js @@ -17,6 +17,7 @@ async function refreshEvents ({commit, dispatch, state, rootState}, [modifiedAft ? `/project/${pid}/event/changes/${(new Date(modifiedAfter)).toISOString()}?unique=t` : `/project/${pid}/event`; const init = { + cache: "reload", signal: state.loading.signal }; const res = await dispatch('api', [url, init]); diff --git a/lib/www/client/source/src/store/modules/label/actions.js b/lib/www/client/source/src/store/modules/label/actions.js index 86a3e1b..28b9421 100644 --- a/lib/www/client/source/src/store/modules/label/actions.js +++ b/lib/www/client/source/src/store/modules/label/actions.js @@ -11,6 +11,7 @@ async function refreshLabels ({commit, dispatch, state, rootState}) { const pid = rootState.project.projectId; const url = `/project/${pid}/label`; const init = { + cache: "reload", signal: state.loading.signal }; const res = await dispatch('api', [url, init]); diff --git a/lib/www/client/source/src/store/modules/line/actions.js b/lib/www/client/source/src/store/modules/line/actions.js index 2431a80..8fe5c60 100644 --- a/lib/www/client/source/src/store/modules/line/actions.js +++ b/lib/www/client/source/src/store/modules/line/actions.js @@ -11,6 +11,7 @@ async function refreshLines ({commit, dispatch, state, rootState}) { const pid = rootState.project.projectId; const url = `/project/${pid}/line`; const init = { + cache: "reload", signal: state.loading.signal }; const res = await dispatch('api', [url, init]); diff --git a/lib/www/client/source/src/store/modules/plan/actions.js b/lib/www/client/source/src/store/modules/plan/actions.js index f0e2087..f177493 100644 --- a/lib/www/client/source/src/store/modules/plan/actions.js +++ b/lib/www/client/source/src/store/modules/plan/actions.js @@ -11,6 +11,7 @@ async function refreshPlan ({commit, dispatch, state, rootState}) { const pid = rootState.project.projectId; const url = `/project/${pid}/plan`; const init = { + cache: "reload", signal: state.loading.signal }; const res = await dispatch('api', [url, init]); diff --git a/lib/www/client/source/src/store/modules/project/actions.js b/lib/www/client/source/src/store/modules/project/actions.js index d03f9cd..7f5143e 100644 --- a/lib/www/client/source/src/store/modules/project/actions.js +++ b/lib/www/client/source/src/store/modules/project/actions.js @@ -2,6 +2,7 @@ async function getProject ({commit, dispatch}, projectId) { const init = { headers: { + cache: "reload", "If-None-Match": "" // Ensure we get a fresh response } }; diff --git a/lib/www/client/source/src/store/modules/projects/actions.js b/lib/www/client/source/src/store/modules/projects/actions.js index 9f33d1b..a604d44 100644 --- a/lib/www/client/source/src/store/modules/projects/actions.js +++ b/lib/www/client/source/src/store/modules/projects/actions.js @@ -11,6 +11,7 @@ async function refreshProjects ({commit, dispatch, state, rootState}) { const pid = rootState.project.projectId; const url = `/project`; const init = { + cache: "reload", signal: state.loading.signal }; const res = await dispatch('api', [url, init, null, {silent:true}]); diff --git a/lib/www/client/source/src/store/modules/sequence/actions.js b/lib/www/client/source/src/store/modules/sequence/actions.js index f4eec87..12d3d2d 100644 --- a/lib/www/client/source/src/store/modules/sequence/actions.js +++ b/lib/www/client/source/src/store/modules/sequence/actions.js @@ -11,6 +11,7 @@ async function refreshSequences ({commit, dispatch, state, rootState}) { const pid = rootState.project.projectId; const url = `/project/${pid}/sequence?files=true`; const init = { + cache: "reload", signal: state.loading.signal }; const res = await dispatch('api', [url, init]);