whalibmob 5.14.17 → 5.14.18
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/lib/Client.js +15 -4
- package/package.json +1 -1
package/lib/Client.js
CHANGED
|
@@ -2397,10 +2397,21 @@ class WhalibmobClient extends EventEmitter {
|
|
|
2397
2397
|
return plaintext;
|
|
2398
2398
|
} catch (err) {
|
|
2399
2399
|
if (!firstErr) firstErr = err;
|
|
2400
|
-
// Only
|
|
2401
|
-
// A session that exists and refuses the
|
|
2402
|
-
// problem, and the answer is a retry
|
|
2403
|
-
|
|
2400
|
+
// Only "this is not where the session lives" is worth asking a
|
|
2401
|
+
// different address about. A session that exists and refuses the
|
|
2402
|
+
// ciphertext is a different problem, and the answer to that is a retry
|
|
2403
|
+
// receipt, not another lookup.
|
|
2404
|
+
//
|
|
2405
|
+
// "Invalid PreKey ID" belongs in the first group, which is not obvious.
|
|
2406
|
+
// A sender keeps sending pkmsg until it hears back, and every one of
|
|
2407
|
+
// them names the same pre-key — so once the first has been opened, that
|
|
2408
|
+
// pre-key is spent. Meeting one under an address that holds no session
|
|
2409
|
+
// is therefore not a mismatched key: it is this address having no
|
|
2410
|
+
// record of the session the pre-key was already spent on, which is
|
|
2411
|
+
// exactly the case for looking under the other name. Without it the
|
|
2412
|
+
// search stopped at the first address and a group we had just joined
|
|
2413
|
+
// stayed unreadable — which is how this was found.
|
|
2414
|
+
if (!/no matching sessions|no session|invalid prekey/i.test(String(err && err.message))) break;
|
|
2404
2415
|
}
|
|
2405
2416
|
}
|
|
2406
2417
|
|