superseriousbusiness / gotosocial

Fast, fun, small ActivityPub server.
https://docs.gotosocial.org
GNU Affero General Public License v3.0
3.69k stars 311 forks source link

[bug] I can't unfollow dead accounts #2634

Closed Hund closed 3 months ago

Hund commented 7 months ago

Describe the bug with a clear and concise description of what the bug is.

I'm unable to unfollow dead accounts from a Mastodon instance that has shut down. I assume that the same issue applies for all dead accounts, no matter what instance it used to be.

What's your GoToSocial Version?

0.13.2

GoToSocial Arch

AMD64 Docker

What happened?

Tapping the unfollow button using Pinafore, I'm simply met with the following message:

Unable to unfollow : Request failed: 404

What you expected to happen?

The user would be unfollowed.

How to reproduce it?

Follow a user, wait until their instance shuts down, unfollow user.

tsmethurst commented 7 months ago

Oh that's annoying indeed. We'll have to investigate what's happening there.

A workaround to this for now would be to suspend the instance from the admin panel if you know it's gone for good. That will tidy up remaining stuff like followers/following, posts, media, etc. If you wanna leave the door open in case the instance comes back, just unsuspend again afterwards. Hope that helps!

daenney commented 7 months ago

I'm actually not sure how we could solve it, beyond some "expunge domain" feature.

A domain starting to return 4xx/5xx codes to some of our requests doesn't let us distinguish between "oh they're actually gone and shut down" versus "technical difficulties". Even if we fail to resolve DNS or open a TCP socket.

In an ideal world, when an instance is closing down that information would be broadcast and we could respond to it by removing the follows. But that doesn't solve the case of an unexpected shutdown (like a domain seizure) or an instance maintainer disappearing and it eventually bitrotting out of existence.

Someone also pointed out the same happens with boosts and favs. If the instance is dead, you can't unboost or unfav a post any more.

tsmethurst commented 7 months ago

I think the issue is probably that trying to interact with an account/status that hasn't been dereffed in a while causes the instance to attempt refresh from remote. If that fails then the action will fail. We may want to better separate the action on the local instance from interaction with the remote instance, such that you can still do/undo things locally even if the remote can't be reached anymore (but then provide no guarantees that the do/undo will actually reach the remote).

Hund commented 7 months ago

@tsmethurst I added the domain in Settings / Admin / Domain permissions /Block. Nothing happened though. I'm still following the dead accounts. :(

tsmethurst commented 7 months ago

If they're accounts with separate host and account domain values, you may need to add both the host and the account domain for side effects to be fully processed. If it's a big domain with lots of connections to you, you may just need to wait a while for side effects to process.

NyaaaWhatsUpDoc commented 3 months ago

just confirmed from my own instance that this is no longer a issue :)

NyaaaWhatsUpDoc commented 3 months ago

(though please feel free to reopen / drop a comment here if this is still an issue for you on latest version @Hund)

Hund commented 3 months ago

Great! Thanks! :)