From 2e2065017e6fe44df1cbe4c7677432ebbb596b60 Mon Sep 17 00:00:00 2001 From: Thodoris Greasidis Date: Wed, 22 Jan 2025 18:22:33 +0200 Subject: [PATCH] Fix PATCH /state/v3 not clearing the device's is_running__release Change-type: patch --- src/features/device-state/routes/state-patch-v3.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/features/device-state/routes/state-patch-v3.ts b/src/features/device-state/routes/state-patch-v3.ts index d67c3e263..8190667fa 100644 --- a/src/features/device-state/routes/state-patch-v3.ts +++ b/src/features/device-state/routes/state-patch-v3.ts @@ -327,7 +327,9 @@ export const statePatchV3: RequestHandler = async (req, res) => { if (apps != null) { const userAppUuid = device.belongs_to__application[0].uuid; - if (releasesByAppUuid[userAppUuid] != null) { + if (Object.keys(apps).length === 0) { + deviceBody.is_running__release = null; + } else if (releasesByAppUuid[userAppUuid] != null) { const release = releasesByAppUuid[userAppUuid].find( (r) => r.commit === apps[userAppUuid].release_uuid, );