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

device.messages may contain stale messages #20

Open
PKGeorgiev opened this issue Mar 8, 2018 · 2 comments
Open

device.messages may contain stale messages #20

PKGeorgiev opened this issue Mar 8, 2018 · 2 comments

Comments

@PKGeorgiev
Copy link

In situations where a registered sonoff device becomes offline or it was unable to acknowledge a packet due to intermittent wifi drop, the message will remain in device.messages forever.

Since message.sequence is a timestamp, a periodic timer could be implemented to clear stale messages (older than X minutes for example).

I have two more questions:

  1. What happens to devices that were not alive more than X minutes? Are they removed from devices list?
  2. Shouldn't the API server return an error code when you try to control a device that is not currently active?
@mdopp
Copy link
Owner

mdopp commented Mar 8, 2018

Hi,
enhancements are welcome!

About the "remove when inactive" => the devices do not send keep-alives, hence we would have to implement the other way around and the server has to send keep-alive-checks.
And yes, it should return an error, when the device is not active! good point

@PKGeorgiev
Copy link
Author

Are you going to realize the stale message removal strategy using a timer?

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

No branches or pull requests

2 participants