@dxos/broadcast
Advanced tools
Comparing version 1.0.0-beta.6 to 1.0.0-beta.7
@@ -208,7 +208,8 @@ "use strict"; | ||
const waitFor = this._peers.map(peer => { | ||
if (!this._running) return; // Don't send the message to the "origin" and/or "from" peer. | ||
if (!this._running) { | ||
return; | ||
} // Don't send the message to the "origin" peer. | ||
if (packet.origin.equals(peer.id) || packet.from.equals(peer.id)) { | ||
this._seenSeqs.add(msgId(packet.seqno, peer.id)); | ||
if (packet.origin.equals(peer.id)) { | ||
return Promise.resolve(); | ||
@@ -218,3 +219,6 @@ } // Don't send the message to neighbors that have already seen the message. | ||
if (this._seenSeqs.has(msgId(packet.seqno, peer.id))) return Promise.resolve(); | ||
if (this._seenSeqs.has(msgId(packet.seqno, peer.id))) { | ||
return Promise.resolve(); | ||
} | ||
log('publish %h -> %h', this._id, peer.id, packet); | ||
@@ -251,8 +255,13 @@ | ||
if (packet.origin.equals(this._id)) return; // Cache the packet as "seen by the peer from". | ||
if (packet.origin.equals(this._id)) { | ||
return; | ||
} // Cache the packet as "seen by the peer from". | ||
this._seenSeqs.add(msgId(packet.seqno, packet.from)); // Check if I already see this packet. | ||
if (this._seenSeqs.has(msgId(packet.seqno, this._id))) return; | ||
if (this._seenSeqs.has(msgId(packet.seqno, this._id))) { | ||
return; | ||
} | ||
@@ -259,0 +268,0 @@ const peer = this._peers.find(peer => peer.id.equals(packet.from)); |
{ | ||
"name": "@dxos/broadcast", | ||
"version": "1.0.0-beta.6", | ||
"version": "1.0.0-beta.7", | ||
"description": "Abstract module to send broadcast messages.", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/dxos/broadcast#readme", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
420
74216