Fix Stats information fails to load when date cannot be parsed when returned from API #22910
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #22859
WPKit-PR: wordpress-mobile/WordPressKit-iOS#771
All of the changes and explanations are within WPKit PR. In short,
DateFormatter
fails to convert a date string (2023-10-01
) string toDate
on rare occasions when DST happens on that particular date at midnight.This PR also contains additional changes due to a state of
WordPressKit
andWordPressAuthenticator
. I'll update WP-iOS PR once WPKit-iOS changes are merged.To test:
The easiest way to reproduce and confirm that the issue is fixed is to follow the steps from #22859
Regression Notes
There shouldn't be any. WPKit-PR: wordpress-mobile/WordPressKit-iOS#771 adds unit tests to make sure that a new date formatter behaves in exact same way but additionally doesn't fail during DST changes.
Unit tests, manual tests
PR submission checklist:
RELEASE-NOTES.txt
if necessary.Testing checklist: