Skip to content

Commit 5af15d0

Browse files
committed
update
1 parent 665e6ec commit 5af15d0

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
@@ -804,12 +804,20 @@ export class HubConnection {
804804

805805
private createInvocation(methodName: string, args: any[], nonblocking: boolean, streamIds: string[]): InvocationMessage {
806806
if (nonblocking) {
807-
return {
808-
arguments: args,
809-
streamIds,
810-
target: methodName,
811-
type: MessageType.Invocation,
812-
};
807+
if (streamIds.length !== 0) {
808+
return {
809+
arguments: args,
810+
streamIds,
811+
target: methodName,
812+
type: MessageType.Invocation,
813+
};
814+
} else {
815+
return {
816+
arguments: args,
817+
target: methodName,
818+
type: MessageType.Invocation,
819+
};
820+
}
813821
} else {
814822
const invocationId = this.invocationId;
815823
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
@@ -165,7 +165,6 @@ describe("HubConnection", () => {
165165
"arg",
166166
42,
167167
],
168-
streamIds: [],
169168
target: "testMethod",
170169
type: MessageType.Invocation,
171170
});
@@ -194,7 +193,6 @@ describe("HubConnection", () => {
194193
"arg",
195194
null,
196195
],
197-
streamIds: [],
198196
target: "testMethod",
199197
type: MessageType.Invocation,
200198
});

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)