Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
When Alice (a fediverse actor) tries to follow a writefreely actor (Bob) and Alice already follows Bob then writefreely crashes. #159
Describe the bug
When a follow is already registered in the writefreely database, repeating the follow request crashes writefreely
Steps to reproduce (if necessary)
Steps to reproduce the behavior:
Nothing probably. Or maybe refresh the public key with the new one?
Version or last commit: 0.10.0
So far I think I figured out the panic, there is an error check when inserting the new actor into the remote users table which previously only checked if the error was NOT for a duplicate key. So if there was a duplicate key it would just continue on trying to proceed, however the response from the db transaction is nil when there is an error, hence the panic.
I changed the check to check for any error and can now POST duplicate follow requests, only seeing an error logged that the key was not unique.
I will submit a PR and we can go from there.