Skip to content

Commit 4d0b36a

Browse files
authored
Merge pull request #4793 from rmosolgo/action-cable-send-fix
ActionCable: don't use send action
2 parents 905b05b + 4a8b553 commit 4d0b36a

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

javascript_client/src/subscriptions/__tests__/createActionCableHandlerTest.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,16 @@ describe("createActionCableHandler", () => {
5151
{text: "", name: "", id: "abcdef"},
5252
{},
5353
{},
54-
{ onError: () => {}, onNext: () => {}, onCompleted: () => {} }
54+
{ onError: () => {}, onNext: (result: any) => { log.push(["onNext", result])}, onCompleted: () => { log.push(["onCompleted", null])} }
5555
)
5656

5757
handlers.connected() // trigger the GraphQL send
58+
handlers.received({ result: { data: { a: "1" } }, more: false })
5859

5960
expect(log).toEqual([
60-
["send", { operationId: "client-1/abcdef", operationName: "", query: "", variables: {} }],
6161
["execute", { operationId: "client-1/abcdef", operationName: "", query: "", variables: {} }],
62+
["onNext", { data: { a: "1" } }],
63+
["onCompleted", null],
6264
])
6365
})
6466
})

javascript_client/src/subscriptions/createActionCableHandler.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ function createActionCableHandler(options: ActionCableHandlerOptions) {
4444
operationId: (operation.id && options.clientName ? (options.clientName + "/" + operation.id) : null),
4545
}
4646
}
47-
channel.perform('send', channelParams)
4847
channel.perform("execute", channelParams)
4948
},
5049
// This result is sent back from ActionCable.

0 commit comments

Comments
 (0)