All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
- Redis subscriptions store configuration has been decoupled from AnyCable, so you can use any broadcasting adapter and configure Redis as you like. @palkan (#44)
-
Stats collection about subscriptions, channels, etc via
GraphQL::AnyCable.stats
. @prog-supdex (#37)See Stats section in README for details.
-
Configuration option
redis_prefix
for namespacing Redis keys. @prog-supdex (#36)
-
Depend on
anycable-core
gem instead ofanycable
.This allows to avoid installing
grpc
gem when using alternate AnyCable broadcasting adapters (like HTTP).See #43 for details.
-
Handling of client-provided channel identifiers. BREAKING CHANGE
Please make sure that you have changed your channel
disconnected
method to pass channel instance to GraphQL-AnyCable'sdelete_channel_subscriptions
method. See release notes for version 1.1.0 for details. -
Handling of pre-1.0 subscriptions data.
If you're still using version 0.5 or below, please upgrade to 1.0 or 1.1 first with
handle_legacy_subscriptions
setting enabled. See release notes for version 1.0.0 for details.
- Fix empty operation name handling when using redis-client or redis.rb v5. @ilyasgaraev (#34)
- Fix deprecation warnings for redis.rb v4.8+ and support for redis.rb v5. @smasry (#29)
- Fix that deprecation warning about
config.use_client_provided_uniq_id
again, so it can be issued outside of Rails. @gsamokovarov (#27)
-
Fix deprecation warning about using client-side channel ids shown even if deprecated functionality was disabled in application code (not via config file or environment variable). @gsamokovarov (#26)
However, now deprecation warning won't be shown if graphql-anycable is used not in Ruby on Rails application.
- Allow using graphql-anycable with GraphQL-Ruby 2.x (it seem to be already compatible). @Envek
- Handling of buggy istate values on unsubscribe (when
use_client_provided_uniq_id: false
). @palkan #20 - A bug when
#unsubscribe
happens before#execute
. @palkan #20
-
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)
-
Guard check for presence of ActionCable channel instance in the GraphQL execution context.
This allows to detect wrong configuration (user forgot to pass channel into context) or wrong usage (subscription query was sent via HTTP request, not via WebSocket channel) of the library and provides clear error message to gem users.
- Support for Subscriptions Broadcast feature in GraphQL-Ruby 1.11+. @Envek (#15)
- Subscription data storage format changed to support broadcasting feature (see #15)
-
Drop support for GraphQL-Ruby before 1.11
-
Drop support for AnyCable before 1.0
-
Drop
:action_cable_stream
option from context: it is not used in reality.See rmosolgo/graphql-ruby#3076 for details
-
Change method of plugging in of this gem from
use GraphQL::Subscriptions::AnyCableSubscriptions
touse GraphQL::AnyCable
:use GraphQL::AnyCable
If you need broadcasting, add
broadcast: true
option and ensure that Interpreter mode is enabled.use GraphQL::Execution::Interpreter use GraphQL::Analysis::AST use GraphQL::AnyCable, broadcast: true, default_broadcastable: true
-
Enable
handle_legacy_subscriptions
setting for seamless upgrade from previous versions:GRAPHQL_ANYCABLE_HANDLE_LEGACY_SUBSCRIPTIONS=true
Disable or remove this setting when you sure that all clients has re-subscribed (e.g. after
subscription_expiration_seconds
has passed after upgrade) as it imposes small performance penalty.
- Allow to plug in this gem by calling
use GraphQL::AnyCable
instead ofuse GraphQL::Subscriptions::AnyCableSubscriptions
. @Envek - Rename
GraphQL::Anycable
constant toGraphQL::AnyCable
for consistency with AnyCable itself. @Envek
Technical release to test publishing via GitHub Actions.
- Deprecation warning for
Redis#exist
usage on Redis Ruby client 4.2+. Switch toexists?
method and require Redis 4.2+ (see #14). @Envek
- Ability to configure the gem via
configure
block, in addition to enironment variables and yaml files. @gsamokovarov (#11) - Ability to run Redis cleaning operations outside of Rake. @gsamokovarov (#11)
- AnyCable 1.0 compatibility. @bibendi, @Envek (#10)
- AnyCable 0.6 compatibility. @Envek
- Subscription expiration and rake task for stale subscriptions cleanup. @Envek
Initial version: store subscriptions on redis, re-execute queries in sync. @Envek