Fix read_subscription returning hash with nil values #51
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Since the upgrade to the 1.3.0 version of this lib, we noticed "No query string was present" errors received on our graphql subscription clients; caused by https://github.com/rmosolgo/graphql-ruby/blob/v2.5.4/lib/graphql/subscriptions.rb#L106 receiving a hash with an nil
query_stringinstead of receiving nil directly.This comes from this change (the
returnmakesread_subscriptionreturn nil, whilenextonly causes the block to early return): 81c3c4c#diff-4e11ab0cfb2b97d55c90a6b52d3c59dcc0c649422f3ad1b1e9e30fe8a06bc6fdR163This PR reverts this small change to handle this case more properly.
I've found however that this still masks a race condition (between finding an existing subscription_id for a fingerprint and reading it, it might have been expired / deleted, which explains why we get these errors; however this prevents other subscriptions from the same fingerprint to receive their notification), but I'll open a separate issue.