Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions web/package/agama-web-ui.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Tue Feb 25 12:36:50 UTC 2025 - Ancor Gonzalez Sosa <ancor@suse.com>

- Synchronous system probing when choosing or registering the
product (gh#agama-project/agama#2072).

-------------------------------------------------------------------
Mon Feb 24 15:57:12 UTC 2025 - David Diaz <dgonzalez@suse.com>

Expand Down
7 changes: 6 additions & 1 deletion web/src/api/manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand All @@ -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 };
14 changes: 7 additions & 7 deletions web/src/queries/software.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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();
}
},
};
Expand All @@ -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);
Expand Down