ssbc / patchwork

A decentralized messaging and sharing app built on top of Secure Scuttlebutt (SSB).
https://www.scuttlebutt.nz
GNU Affero General Public License v3.0
3.58k stars 335 forks source link

Don't always replicate a profile when opening it #1067

Closed Powersource closed 3 years ago

Powersource commented 5 years ago

Situation where this goes badly for @marylychee %diQvJScoWgPk3bh0hvQD1PrN7aNpvDB2MKUeChG2QvU=.sha256

This is usually a nice feature, sometimes it doesn't work so great. e.g. the above example. And when if you see a lot of your friends blocking someone and you want to do it too, at the moment you have to replicate someone before you can block them (since you have to enter their profile to get to the block button).

What's the best solution to this? Before I thought about having a button on all unloaded profiles asking you if you want to load them, but that might be a bit much. I think Mary's suggestion that the button should be there when your friends block someone sounds like a good compromise, but I would suggest lowering the bar from 5 friends to 1 since it's not hard to click that button if you feel confident.

Opinions?

christianbundy commented 5 years ago

I'd also be interested in this sort of thing.

I would suggest lowering the bar from 5 friends to 1 since it's not hard to click that button if you feel confident.

:+1:

ahdinosaur commented 5 years ago

i'm :+1: on a manual button to replicate someone outside your network and removing any auto replication.

ahdinosaur commented 5 years ago

also worth mentioning, this is especially a problem because in order to block someone, you need to go to their profile, which currently causes you to replicate them.

as a real example just meow, i see in my feed that one of my friends blocked someone. i hover over their identity, i notice that 11 of my friends are blocking them, i don't have their name yet so i know i'm not replicating them. since i trust my friends, i want to pre-emptively block them too (aka a "transitive block"), but that would mean going to their profile and replicating them, before i'm able to click the block button.

marylychee commented 5 years ago

yeah i'm suggesting, that if a friend's blocked them... to be able to make the decision first then - to see the reasons/messages for such.

"what are some better tools and user flows for immunity?"

also in terms of scale of "threat" and urgency, maybe there's a way we can flag and collate block reasons, to be clearer. (I wouldn't want to be reading through 50 of my friends reasons for why they block for example).

so when we block, we could flag - political/viewpoint differences, troll, spammy bot, annoying, boring, not relevant, sexual content, hostile/violent, etc.

this could build some sort of crowd immunity.

If it is a bot that can crash your client like it did for mix %lcm7HgPjZlZcZCu1yWpCfnz6Li3dFgyIbZj+pLeLG3A=.sha256

then we could catch it and prevent it.

like before I got it. already Mix, bob, hendrik, kas.... got it... it says 25 of my friends blocked it.

ahdinosaur commented 5 years ago

@mmckegg left a comment on the 'butts: %VU6GgxHAvHOd6x5HI1qMnBp7Wq+CnLivIMiQukv8YZM=.sha256

Patchwork is not supposed to start downloading a profile outside your 2 degrees if someone you follow blocks it. However, if you follow someone that follows them, it will already be downloaded.

Maybe there is a bug?

https://github.com/ssbc/patchwork/blob/88893c9/modules/page/html/render/profile.js#L53

black-puppydog commented 3 years ago

This consistently fails for me.

For example: @5iRlaEcseCZF20hf3El/7SZGtrsiwNHfRvBU6czmLrU=.ed25519 alias @godemperor consistenly get shown to me with full feed, despite being blocked by 12 (!) of my mutual follows (aka friends)

It fails here already: https://github.com/ssbc/patchwork/blob/57ccce81ba723d27f52cdc30a621ec0e5af16c7d/lib/depject/profile/obs/contact.js#L29

If I console.log() the blockers it will come up empty, but then still show me this:

image

For other feeds it correctly determines that there are more than 3 blocking friends, but in both cases it still seems to replicate every time I open the feed.

black-puppydog commented 3 years ago

One idea: might it be that the replications get triggered simply because we are asking some part of the code for feed details like name, bio, avatar, and sbot goes like "huh, don't have those, I better go asking around"?

Powersource commented 3 years ago

If I console.log() the blockers it will come up empty

Maybe you tried it this way but fyi I don't think it works to log it directly since it's an observable. I think it might work better if you log it between e.g. line 37 & 38 https://github.com/ssbc/patchwork/blob/57ccce81ba723d27f52cdc30a621ec0e5af16c7d/lib/depject/profile/obs/contact.js#L37-L38

might it be that the replications get triggered simply because we are asking some part of the code for feed details

I don't think so, we didn't use to have this behaviour until Matt intentionally added the feature. I think I asked him in some thread about it at the time, maybe we could dig that up. And it doesn't happen if you e.g. see someone in the sidebar.

Powersource commented 3 years ago

Yeah this seems to be the relevant code https://github.com/ssbc/patchwork/blob/57ccce81ba723d27f52cdc30a621ec0e5af16c7d/lib/depject/page/html/render/profile.js#L61-L68

black-puppydog commented 3 years ago

@Powersource yeah, that number is definitely 0 for me for "godemperor" even though the count displays correctly...

black-puppydog commented 3 years ago

oh crap I lost my test case. I was trying to "inspect the server process" and it would crash and require reload every time I hit that line you linked. So I restarted patchwork, and now it shows me this:

image

Edit: I tried resetting the patchwork-contacts index, and that gave the same result :point_up: but then, after the indexes were shown as complete, it took a little longer and now it shows the same as in the first screenshot again. And it now also correctly says it won't try and ad-hoc replicate the feed. So I need a new test case....?

black-puppydog commented 3 years ago

Also, if resetting the patchwork-contacts index does indeed help, then the problem might be in there