resgateio / resgate

A Realtime API Gateway used with NATS to build REST, real time, and RPC APIs, where all your clients are synchronized seamlessly.
https://resgate.io
MIT License
685 stars 67 forks source link

Query event preceding get response not discarded #26

Closed jirenius closed 5 years ago

jirenius commented 6 years ago

Issue

If a resource "query" event is received from a service before the response to the "get" request, the event will still be handled causing undefined behaviour.

Solution

Prevent event query requests to be sent if the resourceSubscription is not yet loaded (resourceSubscription.state <= stateRequested)

eventSubscription.go:274

jirenius commented 5 years ago

Fixed in #101 Commit 04f2de70c6438a500594518b4703e35f3e418968 wrongly named GH-25 but should be GH-26.