Add command to fix user duplicates#2047
Conversation
- make the `ActivityPubManager` update the username as well - Add a command to fix duplicate usernames, either by refreshing the remote actors or by merging the users together
|
We already have a command that checks for user duplicates. I know that that command didn't found these issues.. Nevertheless, it would be better for the end user to just have 1 command to once and for all fix user duplicates. 😊 |
|
True, I forgot about that. I will try to consolidate the 2 commands 👍 |
|
What happens with mentions when a user changed their handle? I expect in the current situation they will just be broken, right? |
Yes it would just be broken |
| $user->type = $actor['type'] ?? 'Person'; | ||
| $user->apInboxUrl = $actor['endpoints']['sharedInbox'] ?? $actor['inbox']; | ||
| $user->apDomain = parse_url($actor['id'], PHP_URL_HOST); | ||
| $user->username = '@'.($actor['preferredUsername'] ?? $user->username).'@'.$user->apDomain; |
There was a problem hiding this comment.
I think we should add a log when the handle changed. This way we can create some statistics to estimate if we need to fix possible broken mentions.
- Put all the updates in the command into a transaction - added update cases for magazine bans and activity objects - added logging for changing the handle while updating a user. Also fix the logic there a bit
ActivityPubManagerupdate the username as well