apollo
apollo copied to clipboard
Infinite loop when wrong variables are used in addSmartSubscription
Describe the bug Infinite loop when wrong variables are used in addSmartSubscription. WS messages in network tab:
↑ {
"id":"530",
"type":"start",
"payload":{
"variables":{
"traceToken":"7476730793994548bd69d28094eb665f"
},
"extensions":{
},
"operationName":"extNotification",
"query":"subscription extNotification($traceTokens: [String!]!) ..."
}
}
↓ {
"type":"data",
"id":"530",
"payload":{
"data":null,
"errors":[
{
"message":"Variable \"$traceTokens\" of required type \"[String!]!\" was not provided.",
"locations":[
{
"line":1,
"column":33
}
]
}
]
}
}
↑ {"type": "complete", "id": "530"}
↓ {"id":"530","type":"stop"}
Than it continues with same messages with id 531.
To Reproduce Steps to reproduce the behavior:
- Define smart subscription with addSmartSubscription using invalid variables
- See ws traffic in browser network tab.
Expected behavior When errors are returned while initializing subscription it should not be restarted. Or option should be provided to control when subscription should be retried.
Versions vue: 2.6.14 vue-apollo: 3.1.0 @apollo/client: 3.5.8
Additional context channels_graphql_ws.graphql_ws_consumer is used in backend Probably related to fix for #877