Managing events that arrive out of order

Hi,

I have a hardware issue which I am working to resolve, but it has exposed a potential ‘bug’ in the handling of events by SharpTools.

What happens is my hardware fires off false open/close events at random intervals. These come milliseconds apart. I suspect that these events may be arriving at the SharpTools platform out of order (they are IP packets after all) and if the open arrives after the close my state is now out of sync with reality.

Would it possible to add some logic to detect this by looking for out of order events? Maybe by checking the timestamp and ignoring packets older than the most recent packet received.

I realize that having to keep track of this per ‘thing’ adds complexity.

Thanks for reading.

The event receiving pipeline already does this.

The issue is that SmartThings events drop the millisecond precision and get truncated to seconds precision, so multiple events within the same second look the same. I’ve brought it up with the SmartThings team before, but never got traction on it.

1 Like

I figured you had it covered the best you could.

What about a SharpTool API call to Sync the SmartThings state? If Samsung credentials are needed they could be passed in the URL. (HTTPS only)

Right now its a pain to sign into SharpTools and re-authorize everything to force a sync.

What kind of hardware is it? It seems like fixing the underlying issue would be the right place to focus. I’m open to a Feature Requests to kick off a device-sync without reauthorizing, but it seems like a better fix would be with the device issue itself.

Thanks for the response. I am pursuing the hardware issue in tandem. I agree with you on it being the best approach.

I may eventually send in a feature request for sync without re-authorization but I would never expect a boutique solution just for my benefit.