@decentnetwork/peer 0.1.23 → 0.1.24
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/dist/peer.js +11 -0
- package/package.json +1 -1
package/dist/peer.js
CHANGED
|
@@ -792,6 +792,17 @@ export class Peer {
|
|
|
792
792
|
this.#debugLog(`sendText: in-session send failed for ${pubkey}, falling back to express: ${emsg}`);
|
|
793
793
|
}
|
|
794
794
|
}
|
|
795
|
+
// Never queue an EMPTY message to express. Empty text is used purely as
|
|
796
|
+
// a connection-trigger (e.g. the dora server's 8s session-kick
|
|
797
|
+
// `sendText(target, "")`, which exists only to nudge #initiateSession on
|
|
798
|
+
// a live transport). Offline it carries no data, and queuing one every 8s
|
|
799
|
+
// for every offline friend floods the relay with junk — the observed
|
|
800
|
+
// 80+-message-per-peer piles that timed out every pull. A kick that finds
|
|
801
|
+
// no session is simply a no-op.
|
|
802
|
+
if (text.length === 0) {
|
|
803
|
+
this.#debugLog(`sendText: empty connection-kick to ${pubkey} with no live session — dropping (not flooding express)`);
|
|
804
|
+
return;
|
|
805
|
+
}
|
|
795
806
|
// Offline / fallback path via Carrier express HTTP store-and-forward.
|
|
796
807
|
if (this.#express?.hasNodes()) {
|
|
797
808
|
await this.#express.sendOfflineText(pubkey, packet);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@decentnetwork/peer",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.24",
|
|
4
4
|
"description": "Pure TypeScript port of Elastos Carrier (toxcore-derived) P2P messaging. DHT, onion routing, TCP relay, FlatBuffers app payloads, Express offline relay. Wire-compatible with iOS Beagle and the Carrier C SDK.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|