Skip to content

1.1.0: Allow not to rely on client-generated channel ids

Compare
Choose a tag to compare
@github-actions github-actions released this 17 Nov 13:55
v1.1.0
8589687

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 using graphql-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 the GRAPHQL_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)