robertoszek / pleroma-bot

Bot for mirroring one or multiple Twitter accounts in Pleroma/Mastodon/Misskey.
https://robertoszek.github.io/pleroma-bot
MIT License
104 stars 18 forks source link

unpin_misskey checks for wrong error code when note not found #109

Open ssmucny opened 1 year ago

ssmucny commented 1 year ago

At https://github.com/robertoszek/pleroma-bot/blob/9a64891385d8321a84c37f3fba1fba6bd7b785ee/pleroma_bot/_pin.py#L71 the response code is checked against 404 to see if the note cannot be found, but Misskey returns a 400 when no note is found. See https://misskey.io/api-doc#operation/i/unpin for API reference.

robertoszek commented 1 year ago

Hi! You're absolutely right! I completely missed this on my own testing as the end result was the same on my end due to another bug 😅 (so the bot gave up unpinning it and the post to unpin was already deleted, so no harm no foul there).

Thanks for bringing it to my attention! I have committed the change (and the fix for the another bug) to the develop branch: https://github.com/robertoszek/pleroma-bot/commit/85cfbed9dd0cc65dae2e85c82fa3d7003d5c5943

And I also have published it as a release candidate v1.2.1rc2, which anyone interested or who needs it right now can install like so:

pip install -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple pleroma-bot==1.2.1rc2

Nevertheless, this change will be included on the next stable release, thanks once again for your contribution!