Skip to content

Commit b84f76d

Browse files
authored
fix(predictions): use UTC timezone in date formatter (#3965)
* fix(predictions): use UTC timezone in date formatter * fix failing CI * Add missing changes
1 parent aa1b0ca commit b84f76d

File tree

6 files changed

+14
-12
lines changed

6 files changed

+14
-12
lines changed

.github/workflows/build_scheme.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
id: dependencies-cache
4848
timeout-minutes: 4
4949
continue-on-error: true
50-
uses: actions/cache/restore@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
50+
uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
5151
with:
5252
path: ~/Library/Developer/Xcode/DerivedData/Amplify
5353
key: amplify-packages-${{ hashFiles('Package.resolved') }}
@@ -59,7 +59,7 @@ jobs:
5959
if: steps.dependencies-cache.outputs.cache-hit
6060
timeout-minutes: 4
6161
continue-on-error: true
62-
uses: actions/cache/restore@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
62+
uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
6363
with:
6464
path: ${{ github.workspace }}/Build
6565
key: Amplify-${{ inputs.platform }}-build-cache
@@ -78,7 +78,7 @@ jobs:
7878

7979
- name: Save the dependencies cache in main
8080
if: inputs.save_build_cache && steps.dependencies-cache.outputs.cache-hit != 'true' && github.ref_name == 'main'
81-
uses: actions/cache/save@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
81+
uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
8282
with:
8383
path: ~/Library/Developer/Xcode/DerivedData/Amplify
8484
key: ${{ steps.dependencies-cache.outputs.cache-primary-key }}
@@ -93,7 +93,7 @@ jobs:
9393
9494
- name: Save the build cache
9595
if: inputs.save_build_cache && github.ref_name == 'main'
96-
uses: actions/cache/save@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
96+
uses: actions/cache/save@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
9797
with:
9898
path: ${{ github.workspace }}/Build
9999
key: ${{ steps.build-cache.outputs.cache-primary-key }}

.github/workflows/integ_test_auth_webauthn.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
id: dependencies-cache
4848
timeout-minutes: 4
4949
continue-on-error: true
50-
uses: actions/cache/restore@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
50+
uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
5151
with:
5252
path: ~/Library/Developer/Xcode/DerivedData/Amplify
5353
key: amplify-packages-${{ hashFiles('Package.resolved') }}
@@ -59,7 +59,7 @@ jobs:
5959
if: steps.dependencies-cache.outputs.cache-hit
6060
timeout-minutes: 4
6161
continue-on-error: true
62-
uses: actions/cache/restore@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
62+
uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
6363
with:
6464
path: ${{ github.workspace }}/Build
6565
key: Amplify-iOS-build-cache

.github/workflows/integ_test_push_notifications.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ jobs:
7070
id: dependencies-cache
7171
timeout-minutes: 4
7272
continue-on-error: true
73-
uses: actions/cache/restore@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
73+
uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
7474
with:
7575
path: ~/Library/Developer/Xcode/DerivedData/Amplify
7676
key: amplify-packages-${{ hashFiles('Package.resolved') }}
@@ -82,7 +82,7 @@ jobs:
8282
if: steps.dependencies-cache.outputs.cache-hit
8383
timeout-minutes: 4
8484
continue-on-error: true
85-
uses: actions/cache/restore@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
85+
uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
8686
with:
8787
path: ${{ github.workspace }}/Build
8888
key: Amplify-${{ matrix.platform }}-build-cache

.github/workflows/run_integration_tests.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
id: dependencies-cache
7474
timeout-minutes: 4
7575
continue-on-error: true
76-
uses: actions/cache/restore@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
76+
uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
7777
with:
7878
path: ~/Library/Developer/Xcode/DerivedData/Amplify
7979
key: amplify-packages-${{ hashFiles('Package.resolved') }}
@@ -85,7 +85,7 @@ jobs:
8585
if: steps.dependencies-cache.outputs.cache-hit
8686
timeout-minutes: 4
8787
continue-on-error: true
88-
uses: actions/cache/restore@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
88+
uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
8989
with:
9090
path: ${{ github.workspace }}/Build
9191
key: Amplify-${{ inputs.platform }}-build-cache

.github/workflows/run_unit_tests.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ jobs:
6161
id: dependencies-cache
6262
timeout-minutes: 4
6363
continue-on-error: true
64-
uses: actions/cache/restore@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
64+
uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
6565
with:
6666
path: ~/Library/Developer/Xcode/DerivedData/Amplify
6767
key: amplify-packages-${{ hashFiles('Package.resolved') }}
@@ -73,7 +73,7 @@ jobs:
7373
if: steps.dependencies-cache.outputs.cache-hit
7474
timeout-minutes: 4
7575
continue-on-error: true
76-
uses: actions/cache/restore@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
76+
uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
7777
with:
7878
path: ${{ github.workspace }}/Build
7979
key: Amplify-${{ inputs.platform }}-build-cache

AmplifyPlugins/Predictions/AWSPredictionsPlugin/Liveness/Service/WebSocketSession.swift

+2
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,9 @@ final class WebSocketSession {
128128
}
129129

130130
let dateFormatter = DateFormatter()
131+
dateFormatter.locale = Locale(identifier: "en_US_POSIX")
131132
dateFormatter.dateFormat = "EEE, d MMM yyyy HH:mm:ss z"
133+
dateFormatter.timeZone = TimeZone(secondsFromGMT: 0)
132134
guard let serverDate = dateFormatter.date(from: dateString) else {
133135
Amplify.log.verbose("\(#function): Error parsing Date header in expected format")
134136
onServerDateReceived(nil)

0 commit comments

Comments
 (0)