Skip to content

fix(predictions): use UTC timezone in date formatter #3965

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

Merged
merged 3 commits into from
Mar 11, 2025

Conversation

thisisabhash
Copy link
Member

@thisisabhash thisisabhash commented Mar 10, 2025

Issue #

aws-amplify/amplify-ui-swift-liveness#189

Description

AWS Amplify UI Liveness users with en_TH locale were observing crashes due to AWS server date being incorrectly formatted. This was occurring due to difference in parsing year in Buddhist Calendar vs. Gregorian calendar. Fix involves setting en_US_POSIX locale and GMT timezone in the date formatter.
https://developer.apple.com/library/archive/qa/qa1480/_index.html

General Checklist

  • Added new tests to cover change, if needed
  • Build succeeds with all target using Swift Package Manager
  • All unit tests pass
  • All integration tests pass
  • Security oriented best practices and standards are followed (e.g. using input sanitization, principle of least privilege, etc)
  • Documentation update for the change if required
  • PR title conforms to conventional commit style
  • New or updated tests include Given When Then inline code documentation and are named accordingly testThing_condition_expectation()
  • If breaking change, documentation/changelog update with migration instructions

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@thisisabhash thisisabhash requested a review from a team as a code owner March 10, 2025 21:56
Copy link

codecov bot commented Mar 11, 2025

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Project coverage is 67.70%. Comparing base (1732349) to head (d1b8b4b).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
...ionsPlugin/Liveness/Service/WebSocketSession.swift 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3965      +/-   ##
==========================================
- Coverage   67.82%   67.70%   -0.12%     
==========================================
  Files        1128     1128              
  Lines       52244    52246       +2     
==========================================
- Hits        35434    35374      -60     
- Misses      16810    16872      +62     
Flag Coverage Δ
API_plugin_unit_test 70.33% <ø> (ø)
AWSPluginsCore 69.34% <ø> (ø)
Amplify 47.82% <ø> (ø)
Analytics_plugin_unit_test 85.20% <ø> (ø)
Auth_plugin_unit_test 73.73% <ø> (+0.12%) ⬆️
DataStore_plugin_unit_test 83.36% <ø> (-0.89%) ⬇️
Geo_plugin_unit_test 74.86% <ø> (ø)
Logging_plugin_unit_test 63.11% <ø> (ø)
Predictions_plugin_unit_test 35.40% <0.00%> (-0.02%) ⬇️
PushNotifications_plugin_unit_test 88.43% <ø> (ø)
Storage_plugin_unit_test 76.88% <ø> (ø)
unit_tests 67.70% <0.00%> (-0.12%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@thisisabhash thisisabhash merged commit b84f76d into main Mar 11, 2025
93 checks passed
@thisisabhash thisisabhash deleted the fix/websocket-session-locale branch March 11, 2025 16:25
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.

2 participants