@decentnetwork/peer 0.1.22 → 0.1.23
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 +10 -0
- package/package.json +1 -1
package/dist/peer.js
CHANGED
|
@@ -1773,6 +1773,16 @@ export class Peer {
|
|
|
1773
1773
|
catch {
|
|
1774
1774
|
return;
|
|
1775
1775
|
}
|
|
1776
|
+
// Already an established friend? Ignore this (re-)request. Auto-friend
|
|
1777
|
+
// re-sends and reconnect retries pile up offline friend-requests on the
|
|
1778
|
+
// express relay; once we've accepted them, re-emitting would re-run the
|
|
1779
|
+
// accept path and churn. The express pull still ack-deletes the stale R
|
|
1780
|
+
// via its timestamp watermark — we just don't act on it again.
|
|
1781
|
+
const existingFriend = this.#friends.get(fromUserId);
|
|
1782
|
+
if (existingFriend?.acceptedAt || existingFriend?.status === "online") {
|
|
1783
|
+
this.#debugLog(`ignoring offline friend-request from already-accepted friend ${fromUserId}`);
|
|
1784
|
+
return;
|
|
1785
|
+
}
|
|
1776
1786
|
if (this.#pendingFriendRequests.has(fromUserId)) {
|
|
1777
1787
|
return;
|
|
1778
1788
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@decentnetwork/peer",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.23",
|
|
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",
|