-
Notifications
You must be signed in to change notification settings - Fork 60
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
Events published in same millisecond aren't seen by clients #19
Comments
@concreted this is absolutely a bug. The real fix would be to use a counter instead of timestamp to pick up where the previous longpoll results left off, but that would be a breaking change to any existing clients. I will see if I can come up with a fix that still allows clients to use the since_time query parameter that doesn't require major refactoring. I plan on revisiting this library and making a new version addressing all of the feedback I've received thus far, so if I can't find an easy fix for this now, then it will be addressed in the next major version. Thanks for reporting this. |
… tests that weren't testing said functions
- Added last_id to subscription handler - Updated getEventsSince to consider lastEventID when searching events that match sinceTime - Removed deprecated CreateManager, CreateCustomManager functions
… tests that weren't testing said functions
- Added last_id to subscription handler - Updated getEventsSince to consider lastEventID when searching events that match sinceTime - Removed deprecated CreateManager, CreateCustomManager functions
Fixed in v1.3.0 |
The fix requires using the new The updated golang client and new js-client already use this new param Only custom clients will need to update to use this to get the fixed behavior. |
When two events are published to the
LongpollManager
in the same millisecond, the behavior I observed is that clients will receive the first event only. The other events in the same millisecond can be seen by trying a request again with the samesince_time
, but if clients listen again using thetimestamp
received (as advised in https://github.com/jcuga/golongpoll#http-subscription-handler), they will never see those events.For example, here is sample output from a client listening to a simple
golongpoll
app that is hardcoded to publish two events in quick succession every 10s:Is this behavior expected? I am planning to work around this by forcing a 1ms delay between publishes, but perhaps this could be handled in the
LongpollManager
by aggregating all events in the same millisecond and sending them together?The text was updated successfully, but these errors were encountered: