Skip to content

fix: format Date query parameters as ISO 8601 UTC - #445

Open
pcbeingused333 wants to merge 1 commit into
crowdin:masterfrom
pcbeingused333:fix/list-users-last-seen-date-params
Open

pcbeingused333 wants to merge 1 commit into
crowdin:masterfrom
pcbeingused333:fix/list-users-last-seen-date-params

Conversation

@pcbeingused333

Copy link
Copy Markdown
Contributor

HttpClient.appendUrlParams converted Date query values with toString(), which yields e.g. Wed Oct 23 11:44:02 UTC 2019. The spaces make URI.create throw IllegalArgumentException, so users.listUsers with lastSeenFrom/lastSeenTo (the only Date query parameters today) could not be used at all.

Fix: format Date values with DateTimeFormatter.ISO_INSTANT (e.g. 2019-10-23T11:44:02Z), the ISO 8601 form the API accepts and the same convention as the date handling in #443.

Test: HttpClientTest.appendUrlParamsTest_dateIsFormattedAsIso8601 fails on the original code and passes with the fix; the users and core test packages pass.

AI assistance was used to prepare this change and its tests.

HttpClient.appendUrlParams used Date.toString(), which produces spaces and
a non-ISO format, so users.listUsers with lastSeenFrom/lastSeenTo failed
in URI.create with IllegalArgumentException.

This branch has not been deployed

No deployments
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