ssbc / ssb-friends

Manages the SSB social graph
MIT License
23 stars 6 forks source link

fix glue/replicate logic #66

Closed staltz closed 3 years ago

staltz commented 3 years ago

TL;DR: layered.hopsStream gives us "reduced" data of the follow graph from the perspective of the sbot.id peer, but legacy.stream gives us "non-reduced" updates on the individual edges of the follow graph, from the perspective of the edge outgoing peer.

This was important because we have to call sbot.replicate.block(orig, dest, ...) even if orig !== sbot.id and dest !== sbot.id. Currently, there is no non-legacy API that provides us this kind of information, so that's why I had to use legacy.stream.

This change is very important to fix the tests in ssb-ebt (I tried it out, tests pass).

Eventually, the legacy API will be deleted and I'll make another suitable API, and this file glue/replicate.js will also be deleted. But for now, I just want to get tests in a good shape so that we are confident to make modifications.

staltz commented 3 years ago

This change is very important to fix the tests in ssb-ebt (I tried it out, tests pass).

Wait, this is not entirely true. Some tests in ssb-ebt that use the fixtures generator (ssb-generate) are failing.

staltz commented 3 years ago

Yes! And it gives me a bit more confidence to deprecate some things.