Skip to content

Commit a5127f6

Browse files
committed
still finding bugs
1 parent 716e92b commit a5127f6

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "wa-multi-session",
3-
"version": "1.7.9",
3+
"version": "1.8.0",
44
"description": "Multi Session Whatsapp Library",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

src/Socket/index.ts

+6-9
Original file line numberDiff line numberDiff line change
@@ -58,19 +58,16 @@ export const startSession = async (
5858
callback.get(CALLBACK_KEY.ON_CONNECTING)?.(sessionId);
5959
}
6060
if (connection === "close") {
61-
let retryAttempt = retryCount.get(sessionId) ?? 0;
62-
const shouldRetry = retryAttempt < 5;
61+
// let retryAttempt = retryCount.get(sessionId) ?? 0;
62+
// const shouldRetry = retryAttempt < 5;
6363
const code = (lastDisconnect?.error as Boom)?.output?.statusCode;
64-
if (
65-
code == DisconnectReason.restartRequired ||
66-
(code != DisconnectReason.loggedOut && shouldRetry)
67-
) {
68-
retryAttempt = retryAttempt + 1;
69-
retryCount.set(sessionId, retryAttempt);
64+
if (code !== DisconnectReason.loggedOut) {
65+
// retryAttempt = retryAttempt + 1;
66+
// retryCount.set(sessionId, retryAttempt);
7067
startSocket();
7168
} else {
72-
callback.get(CALLBACK_KEY.ON_DISCONNECTED)?.(sessionId);
7369
deleteSession(sessionId);
70+
callback.get(CALLBACK_KEY.ON_DISCONNECTED)?.(sessionId);
7471
}
7572
}
7673
if (connection == "open") {

0 commit comments

Comments
 (0)