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 ID type of report methods #193

Merged
merged 1 commit into from
Oct 25, 2024
Merged

Conversation

SamWhited
Copy link
Contributor

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.

Signed-off-by: Sam Whited <sam@samwhited.com>
@mattn
Copy link
Owner

mattn commented Oct 24, 2024

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

@codecov-commenter
Copy link

codecov-commenter commented Oct 24, 2024

⚠️ 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 ✅

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

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

Additional details and impacted files
@@            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     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@SamWhited
Copy link
Contributor Author

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
Copy link
Owner

mattn commented Oct 25, 2024

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

@SamWhited
Copy link
Contributor Author

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
Copy link
Owner

mattn commented Oct 25, 2024

make sense. okay will include.

@mattn mattn merged commit 1ef73e8 into mattn:master Oct 25, 2024
7 of 8 checks passed
@mattn
Copy link
Owner

mattn commented Oct 25, 2024

Thanks

@SamWhited SamWhited deleted the report_id_type branch October 25, 2024 01:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants