Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix panic on duplicate remoteuser key #166

Merged
merged 1 commit into from Nov 7, 2019
Merged

fix panic on duplicate remoteuser key #166

merged 1 commit into from Nov 7, 2019

Conversation

ghost
Copy link

@ghost ghost commented Aug 9, 2019

this changes handleFetchCollectionInbox to log all errors after
attempting to insert an actor in the remoteusers table. previously
checking for all errors except duplicate keys would cause a panic if
an actor made a request to follow while already having followed.


  • I have signed the CLA

closes #159

this changes handleFetchCollectionInbox to log _all_ errors after
attempting to insert an actor in the remoteusers table. previously
checking for all errors _except_ duplicate keys would cause a panic if
an actor made a request to follow while already having followed.
@thebaer thebaer added this to the 0.11 milestone Sep 4, 2019
@ghost
Copy link
Author

ghost commented Oct 1, 2019

to test the fix use a local isntance and try something like the following:

curl -H "Content-Type: application/json" \
    --request POST \
    --data '{
    "@context": "https://www.w3.org/ns/activitystreams",
    "id": "https://my-example.com/my-first-follow",
    "type": "Follow",
    "actor": "https://mastodon.technology/@robjloranger",
    "object": "https://mastodon.social/users/Mastodon"
    }' \
    http://localhost:8080/api/collections/rob/inbox

The collection in the target inbox needs to exist and the actor may be any activity pub actor that is live.

@thebaer
Copy link
Member

thebaer commented Nov 7, 2019

Wasn't able to replicate the crash with this (or a few other things I tried), but this should at least fix it. Thanks! Merging now.

@thebaer thebaer merged commit fcf074c into develop Nov 7, 2019
@thebaer thebaer deleted the 159-follow-panic branch November 7, 2019 03:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant