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 Stats information fails to load when date cannot be parsed when returned from API #22910

Open
wants to merge 3 commits into
base: trunk
Choose a base branch
from

Conversation

staskus
Copy link
Contributor

@staskus staskus commented Mar 27, 2024

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 to Date on rare occasions when DST happens on that particular date at midnight.

This PR also contains additional changes due to a state of WordPressKit and WordPressAuthenticator. 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

  1. Switch the time zone to Paraguay/Asuncion
  2. Enable Stats Traffic feature flag
  3. Open Stats Traffic tab
  4. Select weeks
  5. Come back to Sep 25 - Oct 1, 2023 week
  6. Confirm data loads

Regression Notes

  1. Potential unintended areas of impact

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.

  1. What I did to test those areas of impact (or what existing automated tests I relied on)

Unit tests, manual tests

  1. What automated tests I added (or what prevented me from doing so)

PR submission checklist:

  • I have completed the Regression Notes.
  • I have considered adding unit tests for my changes.
  • I have considered adding accessibility improvements for my changes.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

Testing checklist:

  • WordPress.com sites and self-hosted Jetpack sites.
  • Portrait and landscape orientations.
  • Light and dark modes.
  • Fonts: Larger, smaller and bold text.
  • High contrast.
  • VoiceOver.
  • Languages with large words or with letters/accents not frequently used in English.
  • Right-to-left languages. (Even if translation isn’t complete, formatting should still respect the right-to-left layout)
  • iPhone and iPad.
  • Multi-tasking: Split view and Slide over. (iPad)

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Mar 27, 2024

WordPress Alpha📲 You can test the changes from this Pull Request in WordPress Alpha by scanning the QR code below to install the corresponding build.
App NameWordPress Alpha WordPress Alpha
ConfigurationRelease-Alpha
Build Numberpr22910-46dd232
Version24.5
Bundle IDorg.wordpress.alpha
Commit46dd232
App Center BuildWPiOS - One-Offs #9323
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Mar 27, 2024

Jetpack Alpha📲 You can test the changes from this Pull Request in Jetpack Alpha by scanning the QR code below to install the corresponding build.
App NameJetpack Alpha Jetpack Alpha
ConfigurationRelease-Alpha
Build Numberpr22910-46dd232
Version24.5
Bundle IDcom.jetpack.alpha
Commit46dd232
App Center Buildjetpack-installable-builds #8367
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

@staskus staskus requested a review from guarani March 27, 2024 08:55
@staskus staskus modified the milestones: 24.6, 24.7 Mar 27, 2024
@staskus staskus modified the milestones: 24.7, Pending Apr 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stats Traffic: Card information fails to load when date cannot be parsed when returned from API
2 participants