apollo icon indicating copy to clipboard operation
apollo copied to clipboard

Infinite loop when wrong variables are used in addSmartSubscription

Open ChuckBorris33 opened this issue 3 years ago • 0 comments

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:

  1. Define smart subscription with addSmartSubscription using invalid variables
  2. 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

ChuckBorris33 avatar Jun 21 '22 08:06 ChuckBorris33