Skip to content

Commit 6e24e54

Browse files
fix(client): reset _cancelReconnection when scheduler returns void
1 parent 3ac7bb4 commit 6e24e54

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

packages/client/src/client/streamableHttp.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -353,9 +353,7 @@ export class StreamableHTTPClientTransport implements Transport {
353353

354354
if (this._reconnectionScheduler) {
355355
const cancel = this._reconnectionScheduler(reconnect, delay, attemptCount);
356-
if (typeof cancel === 'function') {
357-
this._cancelReconnection = cancel;
358-
}
356+
this._cancelReconnection = typeof cancel === 'function' ? cancel : undefined;
359357
} else {
360358
const handle = setTimeout(reconnect, delay);
361359
this._cancelReconnection = () => clearTimeout(handle);

0 commit comments

Comments
 (0)