Pixelfed: API: Liking/Disliking causes 500 error

Created on 19 Mar 2020  路  3Comments  路  Source: pixelfed/pixelfed

Hi, while working with the api/v1/statuses/:id/favourite and api/v1/statuses/:id/unfavourite endpoints I caused a peculiar bug:

  • If a status is liked via the API and then unliked (also via the API) it results in itreturning a 500 error code. Then afterwards, trying to unlike the post on the website (I tested everything on pixelfed.de) also causes an error of the same nature.
馃悰 Bug 馃 Backend

Most helpful comment

I have fixed the issue in 01525cb, the bug was caused by improperly soft deleting likes.

Admins will need to run a command to fix affected data, it will be released in the next version!

All 3 comments

I could reproduce this, liking, unliking then liking again with the API caused a 500 for me. Then in the web client this happens when trying to press the like button:
afbeelding

Maybe some kind of abuse protection triggering?

The only thing I could see in the API controller is this: https://github.com/pixelfed/pixelfed/blob/dev/app/Http/Controllers/Api/ApiV1Controller.php#L1210
Maybe something about the LikePipeline doesn't like this?

I have fixed the issue in 01525cb, the bug was caused by improperly soft deleting likes.

Admins will need to run a command to fix affected data, it will be released in the next version!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gerhardbeck picture gerhardbeck  路  3Comments

jwildeboer picture jwildeboer  路  5Comments

hellcp picture hellcp  路  4Comments

NFGman picture NFGman  路  5Comments

dansup picture dansup  路  3Comments