moved retryCount before validating the session (#2167)

This commit is contained in:
YonkoSam
2026-01-18 00:11:10 +01:00
committed by GitHub
parent 349e7bd771
commit 1408499d7c
2 changed files with 6 additions and 11 deletions
+1 -6
View File
@@ -109,7 +109,7 @@ export class MessageRetryManager {
/**
* Check if a session should be recreated based on retry count and history
*/
shouldRecreateSession(jid: string, retryCount: number, hasSession: boolean): { reason: string; recreate: boolean } {
shouldRecreateSession(jid: string, hasSession: boolean): { reason: string; recreate: boolean } {
// If we don't have a session, always recreate
if (!hasSession) {
this.sessionRecreateHistory.set(jid, Date.now())
@@ -120,11 +120,6 @@ export class MessageRetryManager {
}
}
// Only consider recreation if retry count > 1
if (retryCount < 2) {
return { reason: '', recreate: false }
}
const now = Date.now()
const prevTime = this.sessionRecreateHistory.get(jid)