block actions do not delete follow activities and cause out-of-sync relationships
hey look at me being nice to you, this is such a longstanding bug that i'd feel bad not letting you know how to replicate it
User.get_follow_state/3 uses a fallback of Utils.fetch_latest_follow/2 to fill the following
field on relationships
however, a User.block/2 call, which in turn called User.unfollow/2, does not remove any follow activities from the database
this means that whilst we've removed the FollowingRelationship
entry and FollowingRelationship.get/2
returns nil
, the value picked up by User.get_follow_state/3
will fall back to the last follow, which was an accept. thus, the two functions will arrive at different results when asked "is "user_a" following "user_b"?
this can result in the very amusing relationship of following: true, blocking: true
being rendered.
to get into follow hell:
- have 2 instances
- follow remote_user with local_user
- ensure the accept returns, accept if neccesary
- block remote_user
- observe that you're both blocking and following the user