Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

epidemic-broadcast-trees

Package Overview
Dependencies
Maintainers
18
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

epidemic-broadcast-trees - npm Package Compare versions

Comparing version 8.0.2 to 8.0.3

.github/workflows/node.js.yml

10

events.js

@@ -46,3 +46,3 @@ 'use strict'

}
// lower numbers should be respected

@@ -188,5 +188,5 @@ // if one is -1 and the other is not, use the other

sent: null,
requested: state.clock[id]
requested: lseq
}
setNotes(peer, id, state.clock[id] || 0, !replicating)
setNotes(peer, id, lseq, !replicating)
}

@@ -215,3 +215,3 @@ }

// peer rejects feed
var seq = peer.clock[ev.id], lseq = state.clock[ev.id] || 0
var seq = peer.clock[ev.id] || 0, lseq = state.clock[ev.id] || 0
if(seq === -1) {

@@ -223,3 +223,3 @@ //peer explicitly does not replicate this feed, don't ask for it.

}
else if(ev.value === true && seq != lseq) {
else if(ev.value === true && seq !== state.clock[ev.id]) {
peer.replicating[ev.id] = {

@@ -226,0 +226,0 @@ rx: true, tx: false,

{
"name": "epidemic-broadcast-trees",
"description": "",
"version": "8.0.2",
"description": "bandwidth efficient broadcast gossip",
"version": "8.0.3",
"homepage": "https://github.com/dominictarr/epidemic-broadcast-trees",

@@ -6,0 +6,0 @@ "repository": {

@@ -195,2 +195,17 @@ var test = require('tape')

test('replicate a hops=2 peer that my hops=1 friend still doesnt have', function (t) {
var state = events.initialize()
state = events.clock(state, {})
state = events.connect(state, {id: 'alice', client: false})
state = events.peerClock(state, {id: 'alice', value: {'alice': 0, 'bob': 0}})
state = events.follow(state, {id: 'alice', value: true})
state = events.follow(state, {id: 'bob', value: true})
t.ok(state.peers['alice'].replicating['bob'])
t.end()
})
test('reply to any clock they send, 1', function (t) {

@@ -360,3 +375,3 @@ var state = {

t.deepEqual(state.peers.bob.notes, {alice: note(4, false)})
t.end()

@@ -363,0 +378,0 @@ })

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc