dominictarr / scuttlebutt

peer-to-peer replicatable data structure
Other
1.32k stars 66 forks source link

Data sync issue #51

Closed vinayk047 closed 6 years ago

vinayk047 commented 6 years ago

I've following network setup

screen shot 2018-01-24 at 3 57 18 pm

1. If i update model A & E at same time than only changes of model A are propagated in network check following image

screen shot 2018-01-24 at 4 01 16 pm

2. If u update model E after few seconds than the changes are propagated in network; check following image.

screen shot 2018-01-24 at 4 03 41 pm

is this normal behaviour or a bug?

dominictarr commented 6 years ago

yes this is correct behaviour

dominictarr commented 6 years ago

oh sorry, you are connecting these streams wrong!

you cannot pipe as to bs AND pipe cs to bs. you should use each stream only once! bs should actually be bs1 bs2 bs3

as = a.createStream()
bs1 = b.createStream()
bs2 = b.createStream()
cs = c.createStream()
as.pipe(bs1).pipe(as)
cs.pipe(bs2).pipe(cs)
//etc...
vinayk047 commented 6 years ago

@dominictarr, Ahh ok. thank you for the answer and a awesome module.