Skip to content

Fix subscription event delivery when some subscriptions expire - #53

Open
prog-supdex wants to merge 3 commits into
anycable:masterfrom
prog-supdex:fix/race-condition-problem
Open

Fix subscription event delivery when some subscriptions expire#53
prog-supdex wants to merge 3 commits into
anycable:masterfrom
prog-supdex:fix/race-condition-problem

Conversation

@prog-supdex

Copy link
Copy Markdown
Contributor

Fix #52

Before this fix, if a subscription expired after checking at the existing moment during processing, no events would be delivered to any subscribers

@prog-supdex

Copy link
Copy Markdown
Contributor Author

GitHub workflow installs graphql 2.5 (here GraphQL-Ruby ~> 2.3), which brings stricter validation for subscriptions here and here

According to the validations, subscription operations must have only one root field
This means we can not use multiple subscription fields in a single query like:

subscription SomeSubscription {
  productCreated { id title }
  productUpdated { id }
}

I have updated the tests (stat_spec and anycable_spec) to follow this limitation

@bunnybilou

Copy link
Copy Markdown

Hi @prog-supdex — thanks for this, matches issue #52 for us too. We've patched read_subscription locally (return nil on missing query_string) to stop the bad broadcasts, but still exposed to the execute_grouped race since it only tries one subscription_id. Any status on getting this merged? Would like to drop our workaround once it lands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Race condition between execute_grouped and read_subscription causing all subscriptions of same fingerprint to fail receiving trigger update

2 participants