Skip to content
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

Change device heartbeat's redis prefix to device-heartbeat-state #1341

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Page-
Copy link
Contributor

@Page- Page- commented May 5, 2023

Change-type: patch

@Page- Page- requested a review from thgreasi May 5, 2023 10:00
).catch(() => {
// Ignore errors
}),
this.updateDeviceModel(deviceId, DeviceOnlineStates.Timeout),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we now move this before the scheduleChangeOfStateForDevice and stop using a Promise.all?
Since scheduleChangeOfStateForDevice runs in parallel, it might have already scheduled a new state change before updateDeviceModel throws, in which case the deleteMessageAsync at the end of the function will not be called, hence ending up w/ 2 messages about the same device in the queue (the old Online->Timeout that wasn't deleted and will be re-received, and the new Timeout->Offline).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants