blynkkk / blynk-library

Blynk library for IoT boards. Works with Arduino, ESP32, ESP8266, Raspberry Pi, Particle, ARM Mbed, etc.
https://blynk.io
MIT License
3.83k stars 1.38k forks source link

Don't send delayed messages out of order! #395

Closed Gaff closed 6 years ago

Gaff commented 6 years ago

I found that messages were sometimes being sent out of order - which seems to confuse the android app in BLE mode. It's a simple bug to fix!

Note that the code would be much kinder if it allowed up to BLYNK_MSG_LIMIT messages through before delaying?

Gaff commented 6 years ago

...I appreciate this bug might have not have been the cause of my issues - but can I humbly suggest you accept this MR anyway? It's a bit confusing to have an embedded single-threaded device send messages out of order and this fix is pretty trivial!

vshymanskyy commented 6 years ago

It's actually the question what the order "should be". msgID is not order number....

Gaff commented 6 years ago

It could be if you applied this fix ;)

I guess the point is what is least surprising. I was rather surprised that the messages were sent out of order. It's not hard to fix :p

vshymanskyy commented 6 years ago

@Gaff sorry, not enough evidence this is really needed. msgID was never intended to be "sequence number"... Closing for now, but we may decide to apply your fix later. Thanks!