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: Allow filter expiration to be set to "indefinite" #582

Merged
merged 1 commit into from
Apr 1, 2024

Conversation

nikclayton
Copy link
Contributor

Mastodon API uses an "empty" expires_in value for a filter to mean "Does not expire" (i.e., indefinite).

This was modelled as a null. Which doesn't work, because Retrofit does not send name/value pairs in encoded forms if the value is null.

Fix this by making the API type a String?, and explicitly using the empty string when indefinite expiry is used. This has to be converted back to an Int? in a few places.

See mastodon/documentation#1216 (comment)

Mastodon API uses an "empty" `expires_in` value for a filter to mean
"Does not expire" (i.e., indefinite).

This was modelled as a null. Which doesn't work, because Retrofit does
not send name/value pairs in encoded forms if the value is null.

Fix this by making the API type a `String?`, and explicitly using the
empty string when indefinite expiry is used. This has to be converted
back to an Int? in a few places.

See mastodon/documentation#1216 (comment)
@nikclayton nikclayton merged commit d65d969 into main Apr 1, 2024
6 checks passed
@nikclayton nikclayton deleted the filter-indefinite-expiry branch April 1, 2024 18:48
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.

1 participant