Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subscription is not working with Variables #1157

Closed
fredericbirke opened this issue Oct 26, 2019 · 4 comments · Fixed by #2596
Closed

Subscription is not working with Variables #1157

fredericbirke opened this issue Oct 26, 2019 · 4 comments · Fixed by #2596
Assignees
Milestone

Comments

@fredericbirke
Copy link
Contributor

fredericbirke commented Oct 26, 2019

Describe the bug
Subscriptions will not work when using variables, because when creating subscriptions stream keys, the variables names are used to create the keys, instead of the actual value of the variable.

This results is, that subscriptions that use variables will never receive any messages, because their stream key is never matched.

image

To Reproduce
Check out this repo (It's a fresh dotnet core 3 project with hc 0.10):
https://github.com/Narmor/hc-subscription-bug

Start the project, open Playground on http://localhost:5000/playground, create 4 editor-tabs and put the following snippets in one tab each:

first editor-tab

subscription {
  onReview(moviewName: "DieHard")
}

second editor-tab

subscription onReviewSub($movieName: String) {
  onReview(moviewName: $movieName)
}

with Variables:

{
  "movieName": "DieHard"
}

third editor-tab

mutation {
  fireSubscriptionEvent(moviewName: "DieHard")
}

fourth editor-tab

mutation fireEvent($movieName: String){
  fireSubscriptionEvent(moviewName: $movieName)
}

with Variables:

{
  "movieName": "DieHard"
}

Start both Subscriptions in the first two editor editor-tabs.
Then fire both mutations in the other two editor-tabs.

Expected behavior
Both open subscriptions will receive exactly the same two values.

@michaelstaib
Copy link
Member

Thanks for filing this issue. I will look into it once I am back from Kiev.

@michaelstaib michaelstaib self-assigned this Oct 26, 2019
@michaelstaib michaelstaib added this to the 10.2.0 milestone Oct 26, 2019
@michaelstaib michaelstaib added 🔍 investigate Indicates that an issue or pull request needs more information. bug and removed 🔍 investigate Indicates that an issue or pull request needs more information. labels Oct 26, 2019
@michaelstaib
Copy link
Member

I can proof now that this is a bug. We will issue a fix for this today.

@michaelstaib
Copy link
Member

This one is fixed with 10.2.0-rc.1

@michaelstaib
Copy link
Member

This issue seems to be back in the 11 branch. I reopened this so we have a trigger to revalidate this.

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 a pull request may close this issue.

2 participants