-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add device update status/last update status event that devices can report #1692
Conversation
a0dff8c
to
878882b
Compare
878882b
to
4540d92
Compare
e5fb3f0
to
edff86a
Compare
01fbab0
to
399c0be
Compare
399c0be
to
1628d67
Compare
@@ -319,6 +330,22 @@ export const statePatchV3: RequestHandler = async (req, res) => { | |||
deviceBody.is_running__release = release.id; | |||
} | |||
} | |||
const { releases } = apps[userAppUuid]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since userAppUuid = device.belongs_to__application[0].uuid
should we first check whether apps[userAppUuid]
is actually there before destructuring it?
const { releases } = apps[userAppUuid]; | |
const releases = apps[userAppUuid]?.releases; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this will only happen in the case that userAppUuid
is null, which should be impossible, but I'll add the check regardless
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So interestingly this change you proposed triggers an error
src/features/device-state/routes/state-patch-v3.ts:321:11 - error TS7022: 'device' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.
@thgreasi, I'm not sure why though. And as a check
const releases = apps[userAppUuid].releases;
does not have any issues
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than that LGTM 👍
7aacd49
to
a2ae396
Compare
…port Change-type: minor
a2ae396
to
7002ae0
Compare
No description provided.