@vielhuber/wahelper 1.6.2 → 1.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/wahelper-daemon.js +17 -12
package/package.json
CHANGED
package/wahelper-daemon.js
CHANGED
|
@@ -651,18 +651,23 @@ export default class wahelperDaemon {
|
|
|
651
651
|
return;
|
|
652
652
|
}
|
|
653
653
|
|
|
654
|
-
//
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
654
|
+
// a disconnect right after a pairing failure is just
|
|
655
|
+
// the symptom — keep the more specific upstream
|
|
656
|
+
// reason (e.g. "rate-overlimit") instead of burying
|
|
657
|
+
// it under a generic "connectionLost"
|
|
658
|
+
if (this.lastError?.source !== 'pairing') {
|
|
659
|
+
let reason =
|
|
660
|
+
DisconnectReason && statusCode
|
|
661
|
+
? Object.keys(DisconnectReason).find(k => DisconnectReason[k] === statusCode)
|
|
662
|
+
: null;
|
|
663
|
+
this.lastError = {
|
|
664
|
+
source: 'disconnect',
|
|
665
|
+
message:
|
|
666
|
+
'connection closed' +
|
|
667
|
+
(reason ? ' (' + reason + ')' : statusCode ? ' (statusCode=' + statusCode + ')' : ''),
|
|
668
|
+
at: Date.now()
|
|
669
|
+
};
|
|
670
|
+
}
|
|
666
671
|
this.consecutiveFailures++;
|
|
667
672
|
// first 3 attempts recover network blips fast (1s/2s/4s),
|
|
668
673
|
// after that back off to 15min so a persistent failure
|