From 8e5b31f60841eb6e285ebdf98e7c85abed90cd52 Mon Sep 17 00:00:00 2001 From: Eric P Green Date: Wed, 18 Dec 2024 10:24:41 -0800 Subject: [PATCH 1/7] Add `refetchOnWindowFocus` to project status queries (#6287) --- .../ProjectGlobalStatusIndicator.svelte | 7 ++++++- .../projects/status/ProjectParseErrors.svelte | 21 ++++++++++++++----- .../projects/status/ProjectResources.svelte | 5 ++++- 3 files changed, 26 insertions(+), 7 deletions(-) diff --git a/web-admin/src/features/projects/status/ProjectGlobalStatusIndicator.svelte b/web-admin/src/features/projects/status/ProjectGlobalStatusIndicator.svelte index 6c6b34569f0..bc0a718d4f5 100644 --- a/web-admin/src/features/projects/status/ProjectGlobalStatusIndicator.svelte +++ b/web-admin/src/features/projects/status/ProjectGlobalStatusIndicator.svelte @@ -30,12 +30,17 @@ .length > 0 ); }, + refetchOnMount: true, + refetchOnWindowFocus: true, }, }, ); $: hasResourceErrors = $hasResourceErrorsQuery.data; - $: projectParserQuery = useProjectParser(queryClient, instanceId); + $: projectParserQuery = useProjectParser(queryClient, instanceId, { + refetchOnMount: true, + refetchOnWindowFocus: true, + }); $: hasParseErrors = $projectParserQuery?.data?.projectParser.state.parseErrors.length > 0; diff --git a/web-admin/src/features/projects/status/ProjectParseErrors.svelte b/web-admin/src/features/projects/status/ProjectParseErrors.svelte index eb1ec2ad4e8..ff32404d884 100644 --- a/web-admin/src/features/projects/status/ProjectParseErrors.svelte +++ b/web-admin/src/features/projects/status/ProjectParseErrors.svelte @@ -8,10 +8,21 @@ import { createRuntimeServiceGetResource } from "@rilldata/web-common/runtime-client"; import { runtime } from "@rilldata/web-common/runtime-client/runtime-store"; - $: projectParserQuery = createRuntimeServiceGetResource($runtime.instanceId, { - "name.kind": ResourceKind.ProjectParser, - "name.name": SingletonProjectParserName, - }); + $: ({ instanceId } = $runtime); + + $: projectParserQuery = createRuntimeServiceGetResource( + instanceId, + { + "name.kind": ResourceKind.ProjectParser, + "name.name": SingletonProjectParserName, + }, + { + query: { + refetchOnMount: true, + refetchOnWindowFocus: true, + }, + }, + ); $: ({ isLoading, isSuccess, data, error } = $projectParserQuery); $: parseErrors = data?.resource?.projectParser.state.parseErrors; @@ -30,7 +41,7 @@ {:else if isSuccess} {#if parseErrors && parseErrors.length > 0}