mattn / go-mastodon

mastodon client for golang
MIT License
604 stars 88 forks source link

Fix ID type of report methods #193

Closed SamWhited closed 4 weeks ago

SamWhited commented 1 month ago

Creating a report currently results in a panic saying that the ID type (int64) does not match the expected type (string). This patch fixes this. It is an API breaking change.

mattn commented 4 weeks ago

If possible, could you please add the link to those changes of mastodon?

codecov-commenter commented 4 weeks ago

:warning: Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 87.14%. Comparing base (9faaa4f) to head (5ef6cb3). Report is 28 commits behind head on master.

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #193 +/- ## ========================================== - Coverage 87.51% 87.14% -0.38% ========================================== Files 15 16 +1 Lines 1354 1408 +54 ========================================== + Hits 1185 1227 +42 - Misses 125 133 +8 - Partials 44 48 +4 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

SamWhited commented 4 weeks ago

If possible, could you please add the link to those changes of mastodon?

I'm not sure what you mean by this, sorry? If you mean that the mastodon Mastodon API has changed, as far as I can tell it has always been a string that contains a number, not an actual JSON int. For example, see the response here:

https://docs.joinmastodon.org/methods/reports/

Unfortunately they don't provide a schema or make any guarantees about the type as far as I can see, but it's currently impossible to use this method because it expects an int and Mastodon returns a string, so it panics.

mattn commented 4 weeks ago

If I remember correctly, mastodon also used type int for ID. Where/When was that change included?

SamWhited commented 4 weeks ago

The changelog on that API method doesn't mention that this has ever been changed, and all the other IDs are strings, so it would surprise me if this one was once different for some reason. I don't recall it ever changing, but I haven't been using the mastodon API the entire time it's been around, so I could be wrong.

mattn commented 4 weeks ago

make sense. okay will include.

mattn commented 4 weeks ago

Thanks