-
Notifications
You must be signed in to change notification settings - Fork 3
Description
Bullwinkle is tremendously helpful for making agent/device comms more robust, but I've run into a corner case today with retries.
The basic issue is that I am not defending well against receiving messages out of order, which will happen if you have a dropped packet and then retry and are sending messages fairly regularly (~once/second seems to do it for me). My code was architected to be robust against dropped messages, but receiving a message after I've already processed a newer one is something that I don't handle very well...
I need to dig into the code a bit, but I'm guessing that an ever incrementing sequence number could be added to each message. If you notice on the partner that a message was skipped, you could wait for some time (half the timeout?) for the retry to be successful and then have those messages handled in the correct order for the .on() code. There might also be some opportunity for prioritizing sending retries vs. regular .send messages on the side where messages originate.