1.1.0: Allow not to rely on client-generated channel ids
Added
-
Support for generating unique channel IDs server-side and storing them in the channel states.
Currently, we rely on
params["channelId"]
to track subscriptions. This value is random when usinggraphql-ruby
JS client, but is not guaranteed to be random in general.Now you can opt-in to use server-side IDs by specifying
use_client_provided_uniq_id: false
in YAML config or thru theGRAPHQL_ANYCABLE_USE_CLIENT_PROVIDED_UNIQ_ID=false
env var.NOTE: Relying on client-side IDs is deprecated and will be removed in the future versions.
You must also update your cleanup code in the
Channel#unsubscribed
:
- channel_id = params.fetch("channelId")
- MySchema.subscriptions.delete_channel_subscriptions(channel_id)
+ MySchema.subscriptions.delete_channel_subscriptions(self)