Django Channels based WebSocket GraphQL server with Graphene-like subscriptions
MIT License
281
stars
84
forks
source link
@prokher We are using the recommended way to set the user on scope described above but could notice on production that `subscribe` functions sometimes execute prior to `on_connect`, at which point the scope is not populated. #75
@prokher We are using the recommended way to set the user on scope described above but could notice on production that subscribe functions sometimes execute prior to on_connect, at which point the scope is not populated.
We've attributed this to subscriptions-transport-ws not waiting for connection ack to initiate subscriptions (and the lack of an option to do so), thus we've enabled strict_ordering on the consumer in order to make sure that the scope is populated when subscriptions are run.
Is there anything else we could do instead? I should mention that we are initializing multiple objects on the scope so there is a benefit to doing it once on connection. Thanks!
@prokher We are using the recommended way to set the user on scope described above but could notice on production that
subscribe
functions sometimes execute prior toon_connect
, at which point the scope is not populated.We've attributed this to
subscriptions-transport-ws
not waiting for connection ack to initiate subscriptions (and the lack of an option to do so), thus we've enabledstrict_ordering
on the consumer in order to make sure that the scope is populated when subscriptions are run.Is there anything else we could do instead? I should mention that we are initializing multiple objects on the scope so there is a benefit to doing it once on connection. Thanks!
Originally posted by @fmoga in https://github.com/datadvance/DjangoChannelsGraphqlWs/issues/23#issuecomment-770979144