bookwyrm-social / bookwyrm

Social reading and reviewing, decentralized with ActivityPub
http://joinbookwyrm.com/
Other
2.17k stars 255 forks source link

refactor Move for more redundancy #3360

Closed hughrun closed 2 months ago

hughrun commented 2 months ago

As outlined in #3354, a use Move fails if the user is moving from a BookWyrm server to another BookWrym server. This is because:

  1. the original code did not announce changes to alsoKnownAs;
  2. the original code always checked the locally saved profile rather than refetching the remote data;

This PR fixes both these problems by forcing MoveUser to always perform a "refresh" of the local data from the remote, and by saving the user with broadcast=True when updating alsoKnownAs ids.

It also adds some tests, which might have (or might not have, depending how they were written) caught this issues if I'd included some originally!

Fixes #3354