DjangoChannelsGraphqlWs icon indicating copy to clipboard operation
DjangoChannelsGraphqlWs copied to clipboard

@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.

Open SebasWilde opened this issue 4 years ago • 1 comments

@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!

Originally posted by @fmoga in https://github.com/datadvance/DjangoChannelsGraphqlWs/issues/23#issuecomment-770979144

SebasWilde avatar Aug 07 '21 03:08 SebasWilde

What error does this usually raise?

e.g. does it say the user is logged out? that info.context.user has an AttributeError?

tony avatar Jan 07 '22 20:01 tony