Skip to content

Commit f727a32

Browse files
committed
update
1 parent 884191f commit f727a32

File tree

3 files changed

+15
-9
lines changed

3 files changed

+15
-9
lines changed

src/SignalR/clients/ts/signalr/src/HubConnection.ts

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -818,12 +818,20 @@ export class HubConnection {
818818

819819
private createInvocation(methodName: string, args: any[], nonblocking: boolean, streamIds: string[]): InvocationMessage {
820820
if (nonblocking) {
821-
return {
822-
arguments: args,
823-
streamIds,
824-
target: methodName,
825-
type: MessageType.Invocation,
826-
};
821+
if (streamIds.length !== 0) {
822+
return {
823+
arguments: args,
824+
streamIds,
825+
target: methodName,
826+
type: MessageType.Invocation,
827+
};
828+
} else {
829+
return {
830+
arguments: args,
831+
target: methodName,
832+
type: MessageType.Invocation,
833+
};
834+
}
827835
} else {
828836
const invocationId = this.invocationId;
829837
this.invocationId++;

src/SignalR/clients/ts/signalr/tests/HubConnection.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,6 @@ describe("HubConnection", () => {
184184
"arg",
185185
42,
186186
],
187-
streamIds: [],
188187
target: "testMethod",
189188
type: MessageType.Invocation,
190189
});
@@ -213,7 +212,6 @@ describe("HubConnection", () => {
213212
"arg",
214213
null,
215214
],
216-
streamIds: [],
217215
target: "testMethod",
218216
type: MessageType.Invocation,
219217
});

src/SignalR/clients/ts/signalr/tests/MessageSize.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ describe("Message size", () => {
3232

3333
// Verify the message is sent
3434
expect(connection.sentData.length).toBe(1);
35-
expect((connection.sentData[0] as string).length).toEqual(59);
35+
expect((connection.sentData[0] as string).length).toEqual(44);
3636
} finally {
3737
// Close the connection
3838
await hubConnection.stop();

0 commit comments

Comments
 (0)