diff --git a/client/src/features/sessionsV2/PauseOrDeleteSessionModal.tsx b/client/src/features/sessionsV2/PauseOrDeleteSessionModal.tsx index b02da4d23..a61368495 100644 --- a/client/src/features/sessionsV2/PauseOrDeleteSessionModal.tsx +++ b/client/src/features/sessionsV2/PauseOrDeleteSessionModal.tsx @@ -37,11 +37,11 @@ import { ABSOLUTE_ROUTES } from "../../routing/routes.constants"; import AppContext from "../../utils/context/appContext"; import useLegacySelector from "../../utils/customHooks/useLegacySelector.hook"; import { toHumanRelativeDuration } from "../../utils/helpers/DurationUtils"; +import { useWaitForSessionStatusV2 } from "../session/useWaitForSessionStatus.hook"; import { usePatchSessionMutation, useStopSessionMutation, -} from "../session/sessions.api"; -import { useWaitForSessionStatusV2 } from "../session/useWaitForSessionStatus.hook"; +} from "../sessionsV2/sessionsV2.api"; import styles from "../session/components/SessionModals.module.scss"; import { SessionV2 } from "./sessionsV2.types"; @@ -112,7 +112,7 @@ function AnonymousDeleteSessionModal({ const [isStopping, setIsStopping] = useState(false); const onStopSession = useCallback(async () => { - stopSession({ serverName: sessionName }); + stopSession({ session_id: sessionName }); setIsStopping(true); }, [sessionName, stopSession]); @@ -227,7 +227,7 @@ function PauseSessionModalContent({ const [isStopping, setIsStopping] = useState(false); const onHibernateSession = useCallback(async () => { - patchSession({ sessionName, state: "hibernated" }); + patchSession({ session_id: sessionName, state: "hibernated" }); setIsStopping(true); }, [patchSession, sessionName]); @@ -336,7 +336,7 @@ function DeleteSessionModalContent({ const [isStopping, setIsStopping] = useState(false); const onStopSession = useCallback(async () => { - stopSession({ serverName: sessionName }); + stopSession({ session_id: sessionName }); setIsStopping(true); }, [sessionName, stopSession]); diff --git a/client/src/features/sessionsV2/SessionStartPage.tsx b/client/src/features/sessionsV2/SessionStartPage.tsx index 01cbf2ed1..033a5045f 100644 --- a/client/src/features/sessionsV2/SessionStartPage.tsx +++ b/client/src/features/sessionsV2/SessionStartPage.tsx @@ -38,9 +38,7 @@ import useAppDispatch from "../../utils/customHooks/useAppDispatch.hook"; import useAppSelector from "../../utils/customHooks/useAppSelector.hook"; import { resetFavicon, setFavicon } from "../display"; -import { - storageDefinitionAfterSavingCredentialsFromConfig, -} from "../project/utils/projectCloudStorage.utils"; +import { storageDefinitionAfterSavingCredentialsFromConfig } from "../project/utils/projectCloudStorage.utils"; import type { Project } from "../projectsV2/api/projectV2.api"; import { projectV2Api, diff --git a/client/src/features/sessionsV2/sessionsV2.api.ts b/client/src/features/sessionsV2/sessionsV2.api.ts index 247091418..ef2316b38 100644 --- a/client/src/features/sessionsV2/sessionsV2.api.ts +++ b/client/src/features/sessionsV2/sessionsV2.api.ts @@ -176,7 +176,7 @@ const sessionsV2Api = createApi({ transformResponse: (result: unknown) => { return result && typeof result == "string" ? JSON.parse(result) - : result; //TODO ANDREA temporal fix + : result; }, keepUnusedDataFor: 0, }), diff --git a/server/src/websocket/handlers/sessionsV2.ts b/server/src/websocket/handlers/sessionsV2.ts index d21f543c6..e359e0329 100644 --- a/server/src/websocket/handlers/sessionsV2.ts +++ b/server/src/websocket/handlers/sessionsV2.ts @@ -64,9 +64,9 @@ function sendMessage(data: string, channel: Channel) { } function heartbeatRequestSessionStatusV2({ - channel, - apiClient, - headers, + channel, + apiClient, + headers, }: WebSocketHandlerArgs): void { const previousStatuses = channel.data.get("sessionStatusV2") as string; apiClient