misskey-dev / misskey

🌎 An interplanetary microblogging platform πŸš€
https://misskey-hub.net/
GNU Affero General Public License v3.0
9.85k stars 1.33k forks source link

Can't follow user, stuck on processing #11457

Closed ewof closed 1 year ago

ewof commented 1 year ago

πŸ’‘ Summary

If you make an account and follow a remote user then delete the postgres db without unfollowing the user when you remake the db and make the account again you won't be able to follow that remote user, it will be stuck on processing. Misskey will create the remote and local user but the original account that followed the remote account without unfollowing it before the postgres db wipe cannot follow the remote account. If you unfollow the remote user before wiping the postgres db you can follow them when you remake your account after wiping the postgres db. Accounts with different usernames can follow the user just fine too.

πŸ₯° Expected Behavior

It follows the user correctly

🀬 Actual Behavior

The follow request is stuck on processing.

πŸ“ Steps to Reproduce

  1. Create a misskey instance following https://misskey-hub.net/en/docs/install/manual.html
  2. Create an account
  3. Follow a remote user
  4. Wipe the postgres db by dropping the table and user
  5. Recreate the postgres db/user be following the instructions linked in step 1
  6. Create an account with the same name as done in step 2
  7. Try to follow remote user

πŸ“Œ Environment

b465bcd

πŸ’» Frontend

πŸ›° Backend (for server admin)

NagaseYami commented 1 year ago

This is a known issue that has not been fixed yet. I have tested it multiple times, and the general observations are as follows:

  1. Prepare two servers, SA, and SB. SA runs Mastodon, while SB runs Misskey.
  2. Create user UA on SA and user UB on SB.
  3. UA follows UB, and then use the Mastodon CLI command "tootctl account delete" to delete UA.
  4. Confirm that SB can no longer retrieve UA's information properly.
  5. Check SB's database and confirm the ID of the deleted UA.
  6. Recreate user UA on SA and have them follow UB again.
  7. At this point, an error appears in SB's server log, indicating that the user XXX cannot be found. XXX is a newly generated ID that cannot be found in SB's database.
  8. After restarting server SB, using UA to follow UB again, this time the follow action is successful.
NagaseYami commented 1 year ago

In summary, if you follow a remote user, and subsequently, due to some reason, your account or DB disappears, then until the remote server restarts or the cache expires, the deleted username will be unable to follow anyone on this remote server again.