Skip to content

Commit

Permalink
Fix PATCH /state/v3 not clearing the device's is_running__release
Browse files Browse the repository at this point in the history
Change-type: patch
  • Loading branch information
thgreasi committed Jan 28, 2025
1 parent 5cda4f2 commit f5fece9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/features/device-state/routes/state-patch-v3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -327,9 +327,12 @@ export const statePatchV3: RequestHandler = async (req, res) => {

if (apps != null) {
const userAppUuid = device.belongs_to__application[0].uuid;
if (releasesByAppUuid[userAppUuid] != null) {
const userAppPayload = apps[userAppUuid];
if (userAppPayload?.release_uuid == null) {
deviceBody.is_running__release = null;
} else if (releasesByAppUuid[userAppUuid] != null) {
const release = releasesByAppUuid[userAppUuid].find(
(r) => r.commit === apps[userAppUuid].release_uuid,
(r) => r.commit === userAppPayload.release_uuid,
);
if (release) {
deviceBody.is_running__release = release.id;
Expand Down

0 comments on commit f5fece9

Please # to comment.