Skip to content

Commit ea805ef

Browse files
authored
Merge pull request #105 from JJ-Cro/master
fix(v1.1.7): update circular ws issue
2 parents a0d253b + b7a5292 commit ea805ef

File tree

3 files changed

+8
-17
lines changed

3 files changed

+8
-17
lines changed

package-lock.json

Lines changed: 2 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "coinbase-api",
3-
"version": "1.1.6",
3+
"version": "1.1.7",
44
"description": "Node.js SDK for Coinbase's Advanced Trade, App, Exchange, International, Prime & Commerce REST APIs and WebSockets, with TypeScript & strong end to end tests.",
55
"scripts": {
66
"clean": "rm -rf dist",

src/lib/BaseWSClient.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,12 +375,15 @@ export abstract class BaseWebsocketClient<
375375
return { wsKey };
376376
}
377377

378-
if (this.wsStore.isConnectionAttemptInProgress(wsKey)) {
378+
if (
379+
// Important: don't check for RECONNECTING here, or this clashes with reconnectWithDelay()!
380+
this.wsStore.isConnectionState(wsKey, WsConnectionStateEnum.CONNECTING)
381+
) {
379382
this.logger.error(
380383
'Refused to connect to ws, connection attempt already active',
381384
{ ...WS_LOGGER_CATEGORY, wsKey },
382385
);
383-
return;
386+
return this.wsStore.getConnectionInProgressPromise(wsKey)?.promise;
384387
}
385388

386389
if (

0 commit comments

Comments
 (0)