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

Reaccess event discarded if received prior to get response #25

Closed jirenius closed 5 years ago

jirenius commented 6 years ago

Issue

If a resource "reaccess" event is received from a service before the response to the "get" request, the event will be discarded without triggering another "access" request.

resourceSubscription.go:114 subscription.go:465

This may cause clients to be able to receive events on a resource for which access has been removed.

Solution

Pass "reaccess" events further to the Subcription that may queue it. The event should be handled as soon as the resource is loaded.

jirenius commented 5 years ago

Fixed in #100