McKael / madonctl

CLI client for the Mastodon social network API
MIT License
193 stars 9 forks source link

madonctl fails with Mastodon v2.0.0 #9

Closed Aldarone closed 6 years ago

Aldarone commented 6 years ago

There is a breaking change in Mastodon v2.0.0 which breaks clients and madonctl is impacted :

https://github.com/tootsuite/mastodon/releases/tag/v2.0.0

All id attributes in the REST API responses, including attributes that end in _id, are now returned as strings instead of integers. This is because large integers cannot be encoded in JSON losslessly, and all IDs in Mastodon are now bigint. Some apps will not work with this release until they are updated

Currently, madonctl fail with :

Error: app registration failed: cannot decode API response (POST): json: cannot unmarshal string into Go struct field registerApp.id of type int64
McKael commented 6 years ago

Thanks, I'll look into it!

McKael commented 6 years ago

What's ugly is that the API has been broken without changing the API version. I'm not sure I want to add much code to have madon/madonctl handle both types, I propose I simply release madon & madonctl 2.0 for mastodon version >= v2.0.0.

(Eventually all servers will use the API with string IDs anyways)

McKael commented 6 years ago

@Aldarone Please let me know if it works for you; I've also uploaded some binaries for people not building from source to test...

McKael commented 6 years ago

Uh. I didn't test registration itself so this specific issue is actually not solved. I'll push an update shortly.

McKael commented 6 years ago

Fixed by https://github.com/McKael/madon/commit/5453598cf61679efd2bca7670be1751efc5d534e.

Aldarone commented 6 years ago

Yes, it works perfectly ! Thank you 🙂

McKael commented 6 years ago

Nice! Closing the issue, thanks for the feedback!