ssbc / ssb-ebt

secure scuttlebutt replication with epidemic-broadcast-trees
MIT License
18 stars 10 forks source link

Fix blocking not working. #12

Closed arj03 closed 6 years ago

arj03 commented 6 years ago

So I recently blocked a person because they were rather spammy, but I kept seeing their messages. So I dug in and looked through the code until I found the place were it was supposed to happen and it seems like either the format of sbot.friends.stream has changed or this code has never worked.

I'm publishing it now for people with similar problems. I'd like to run it for a few days to make sure it actually fixes the problem for good.

dominictarr commented 6 years ago

oh... I recall that the stream format of flumeview.reduce is it sends the aggregation first (which is why it looks like the graph) then it uses the {from, to, value} format... I'm pretty sure that it passed the scuttlebot tests...

dominictarr commented 6 years ago

ah yup... this breaks the scuttlebot tests. There are two problems here... the bigger one being that the block tests didn't cover the when the flumeview had already been loaded.

Actually the code should still be able to process {from,to,value} like before. but should also understand do what you did.

arj03 commented 6 years ago

Right. With this latest change, tests are passing again. Thanks for clearing that up. On that note, I find that streaming API to a bit confusing. Are you open to changing that?

dominictarr commented 6 years ago

@arj03 yes. I'm currently trying to rewrite the friends algorithm. (it's taking ages though... latest implementation is at http://github.com/dominictarr/reach but I've realized that it's order dependant, which is not what I want)

dominictarr commented 6 years ago

merged into 5.2.1

btw, my process for stuff like this, is always to link it into the scuttlebot (and/or secure-scuttlebutt) dep tree and run those tests too) if there was anything front end clients with tests I'd run those too!