From dacf173123236518bbee604d83494fed756ef122 Mon Sep 17 00:00:00 2001 From: Ancor Gonzalez Sosa Date: Tue, 25 Feb 2025 12:30:49 +0000 Subject: [PATCH 1/2] web: Synchronous probing when registering or choosing product --- web/src/api/manager.ts | 7 ++++++- web/src/queries/software.ts | 14 +++++++------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/web/src/api/manager.ts b/web/src/api/manager.ts index 856e404813..b2fe97c316 100644 --- a/web/src/api/manager.ts +++ b/web/src/api/manager.ts @@ -27,6 +27,11 @@ import { get, post } from "~/api/http"; */ const startProbing = () => post("/api/manager/probe"); +/** + * Triggers a synchronous probing process. + */ +const probe = () => post("/api/manager/probe_sync"); + /** * Starts the installation process. * @@ -44,4 +49,4 @@ const finishInstallation = () => post("/api/manager/finish"); */ const fetchLogs = () => get("/api/manager/logs/store"); -export { startProbing, startInstallation, finishInstallation, fetchLogs }; +export { startProbing, probe, startInstallation, finishInstallation, fetchLogs }; diff --git a/web/src/queries/software.ts b/web/src/queries/software.ts index e0ead01fcc..34710f40fa 100644 --- a/web/src/queries/software.ts +++ b/web/src/queries/software.ts @@ -54,7 +54,7 @@ import { updateConfig, } from "~/api/software"; import { QueryHookOptions } from "~/types/queries"; -import { startProbing } from "~/api/manager"; +import { probe as systemProbe } from "~/api/manager"; /** * Query to retrieve software configuration @@ -133,13 +133,13 @@ const useConfigMutation = () => { const query = { mutationFn: updateConfig, - onSuccess: (_, config: SoftwareConfig) => { + onSuccess: async (_, config: SoftwareConfig) => { queryClient.invalidateQueries({ queryKey: ["software/config"] }); + queryClient.invalidateQueries({ queryKey: ["software/product"] }); queryClient.invalidateQueries({ queryKey: ["software/proposal"] }); if (config.product) { - queryClient.invalidateQueries({ queryKey: ["software/product"] }); + await systemProbe(); queryClient.invalidateQueries({ queryKey: ["storage"] }); - startProbing(); } }, }; @@ -157,10 +157,10 @@ const useRegisterMutation = () => { const query = { mutationFn: register, - onSuccess: () => { + onSuccess: async () => { + await systemProbe(); queryClient.invalidateQueries({ queryKey: ["software/registration"] }); - queryClient.invalidateQueries({ queryKey: ["storage", "productParams"] }); - startProbing(); + queryClient.invalidateQueries({ queryKey: ["storage"] }); }, }; return useMutation(query); From ce7287a5750b261fc6223587ef476eff5cd36620 Mon Sep 17 00:00:00 2001 From: Ancor Gonzalez Sosa Date: Tue, 25 Feb 2025 12:38:14 +0000 Subject: [PATCH 2/2] web: Changelog --- web/package/agama-web-ui.changes | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/web/package/agama-web-ui.changes b/web/package/agama-web-ui.changes index 1cbec2fc0b..24f7d653b3 100644 --- a/web/package/agama-web-ui.changes +++ b/web/package/agama-web-ui.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Feb 25 12:36:50 UTC 2025 - Ancor Gonzalez Sosa + +- Synchronous system probing when choosing or registering the + product (gh#agama-project/agama#2072). + ------------------------------------------------------------------- Mon Feb 24 15:57:12 UTC 2025 - David Diaz