activitypub.resolve_remote_id
throws IntegrityError
if remote user has unknown alias
#3426
Labels
bug
Something isn't working
Describe the bug
Resolving remote users who have unknown users set as an alias may fail.
To Reproduce
Steps to reproduce the behavior:
activitypub.resolve_remote_id
to retrieve details of remote user A and add them to the local DBalso_known_as
listnull value in column "to_user_id" of relation "bookwyrm_user_also_known_as" violates not-null constraint
Expected behavior
activitypub.resolve_remote_id
should deal with unknown alias users, probably by recursively callingactivitypub.resolve_remote_id
on every aliasScreenshots
If applicable, add screenshots to help explain your problem.
Instance
Development instance
Additional context
I stumbled across this when I was doing some work on improving user imports. So caveat on this: I think there is a broader bug, but it's possible this is only relevant for user imports.
Thinking about what is actually happening here, it's possible this is actually even worse because if the user ID does exist in the local DB, would it just set a totally different user as the alias? Need to do some more testing.
Desktop (please complete the following information):
- OS: [e.g. iOS]: Docker on Mac
- Browser [e.g. chrome, safari]: Firefox
- Version [e.g. 22]:
main
branchThe text was updated successfully, but these errors were encountered: