Skip to content

Commit afaf415

Browse files
committed
resolve merge conflicts
2 parents 861c368 + ef85f6c commit afaf415

16 files changed

+162
-43
lines changed

.github/workflows/issue_closed.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ permissions:
1010
jobs:
1111
cleanup-labels:
1212
runs-on: ubuntu-latest
13-
if: ${{ (contains(github.event.issue.labels.*.name, 'pending-response') || contains(github.event.issue.labels.*.name, 'closing soon') || contains(github.event.issue.labels.*.name, 'pending-release')) }}
13+
if: ${{ contains(github.event.issue.labels.*.name, 'pending-community-response') || contains(github.event.issue.labels.*.name, 'pending-maintainer-response') || contains(github.event.issue.labels.*.name, 'closing soon') || contains(github.event.issue.labels.*.name, 'pending-release') || contains(github.event.issue.labels.*.name, 'pending-triage') }}
1414
steps:
15-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
16-
- name: remove unnecessary labels after closing
15+
- name: Remove unnecessary labels after closing
1716
shell: bash
1817
env:
1918
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2019
ISSUE_NUMBER: ${{ github.event.issue.number }}
20+
REPOSITORY_NAME: ${{ github.event.repository.full_name }}
2121
run: |
22-
gh issue edit $ISSUE_NUMBER --remove-label "closing soon" --remove-label "pending-response" --remove-label "pending-release"
22+
gh issue edit $ISSUE_NUMBER --repo $REPOSITORY_NAME --remove-label "closing soon" --remove-label "pending-community-response" --remove-label "pending-maintainer-response" --remove-label "pending-release" --remove-label "pending-triage"
2323
2424
comment-visibility-warning:
2525
runs-on: ubuntu-latest

.github/workflows/issue_comment.yml

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,27 @@ jobs:
1919
shell: bash
2020
run: echo $COMMENT | sed "s/\\\n/. /g; s/\\\r//g; s/[^a-zA-Z0-9 &().,:]//g" | xargs -I {} curl -s POST "$WEBHOOK_URL" -H "Content-Type:application/json" --data '{"comment":"{}", "commentUrl":"'$COMMENT_URL'", "user":"'$USER'"}'
2121

22-
remove-pending-response-label:
22+
adjust-labels:
2323
runs-on: ubuntu-latest
2424
permissions:
2525
issues: write
26-
if: ${{ !github.event.issue.pull_request && contains(github.event.issue.labels.*.name, 'pending-response') }}
26+
env:
27+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
ISSUE_NUMBER: ${{ github.event.issue.number }}
29+
REPOSITORY_NAME: ${{ github.event.repository.full_name }}
2730
steps:
28-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 #v4.1.1
29-
- name: remove unnecessary labels after comment
31+
- name: remove pending-community-response when new comment received
32+
if: ${{ !contains(fromJSON('["MEMBER", "OWNER"]'), github.event.comment.author_association) && !github.event.issue.pull_request }}
33+
shell: bash
34+
run: |
35+
gh issue edit $ISSUE_NUMBER --repo $REPOSITORY_NAME --remove-label "pending-community-response"
36+
- name: add pending-maintainer-response when new community comment received
37+
if: ${{ !contains(fromJSON('["MEMBER", "OWNER"]'), github.event.comment.author_association) }}
38+
shell: bash
39+
run: |
40+
gh issue edit $ISSUE_NUMBER --repo $REPOSITORY_NAME --add-label "pending-maintainer-response"
41+
- name: remove pending-maintainer-response when new owner/member comment received
42+
if: ${{ contains(fromJSON('["MEMBER", "OWNER"]'), github.event.comment.author_association) }}
3043
shell: bash
31-
env:
32-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33-
ISSUE_NUMBER: ${{ github.event.issue.number }}
3444
run: |
35-
gh issue edit $ISSUE_NUMBER --remove-label "pending-response"
45+
gh issue edit $ISSUE_NUMBER --repo $REPOSITORY_NAME --remove-label "pending-maintainer-response"

.github/workflows/issue_opened.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,25 @@ jobs:
1818
shell: bash
1919
run: echo $ISSUE | sed 's/[^a-zA-Z0-9 &().,:]//g' | xargs -I {} curl -s POST "$WEBHOOK_URL" -H "Content-Type:application/json" --data '{"issue":"{}", "issueUrl":"'$ISSUE_URL'", "user":"'$USER'"}'
2020

21+
add-issue-opened-labels:
22+
runs-on: ubuntu-latest
23+
permissions:
24+
issues: write
25+
env:
26+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27+
ISSUE_NUMBER: ${{ github.event.issue.number }}
28+
REPOSITORY_NAME: ${{ github.event.repository.full_name }}
29+
steps:
30+
- name: Add the pending-triage label
31+
shell: bash
32+
run: |
33+
gh issue edit $ISSUE_NUMBER --repo $REPOSITORY_NAME --add-label "pending-triage"
34+
- name: Add the pending-maintainer-response label
35+
if: ${{ !contains(fromJSON('["MEMBER", "OWNER"]'), github.event.issue.author_association) }}
36+
shell: bash
37+
run: |
38+
gh issue edit $ISSUE_NUMBER --repo $REPOSITORY_NAME --add-label "pending-maintainer-response"
39+
2140
maintainer-opened:
2241
runs-on: ubuntu-latest
2342
permissions:
@@ -29,5 +48,6 @@ jobs:
2948
env:
3049
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3150
ISSUE_NUMBER: ${{ github.event.issue.number }}
51+
REPOSITORY_NAME: ${{ github.event.repository.full_name }}
3252
run: |
33-
gh issue comment $ISSUE_NUMBER --repo aws-amplify/amplify-ui-swift-liveness -b "This issue was opened by a maintainer of this repository; updates will be posted here. If you are also experiencing this issue, please comment here with any relevant information so that we're aware and can prioritize accordingly."
53+
gh issue comment $ISSUE_NUMBER --repo $REPOSITORY_NAME -b "This issue was opened by a maintainer of this repository; updates will be posted here. If you are also experiencing this issue, please comment here with any relevant information so that we're aware and can prioritize accordingly."

CHANGELOG.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,37 @@
11
# Changelog
22

3+
## 1.3.2 (2024-08-20)
4+
5+
## 1.3.1 (2024-08-19)
6+
7+
### Bug Fixes
8+
9+
- Returning .userCancelled when the app goes to the background during a Liveness check. (#167)
10+
11+
## 1.3.0 (2024-08-06)
12+
13+
### Features
14+
15+
- Adding new error when the camera is not available even though permissions were granted. (#163)
16+
17+
## 1.2.18 (2024-07-29)
18+
19+
### Bug Fixes
20+
21+
- Fixing a crash when attempting to call finishWriting (#161)
22+
23+
## 1.2.17 (2024-07-11)
24+
25+
### Bug Fixes
26+
27+
- Updating the camera frame position when the subviews are laid out (#158)
28+
29+
## 1.2.16 (2024-07-02)
30+
31+
### Bug Fixes
32+
33+
- Fixing video not being mirrored in the 'Get Ready' screen (#153)
34+
335
## 1.2.15 (2024-06-26)
436

537
## 1.2.14 (2024-05-15)

HostApp/HostApp.xcodeproj/project.pbxproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
97D1A8E92BA3757700FF1368 /* AWSAPIPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 97D1A8E82BA3757700FF1368 /* AWSAPIPlugin */; };
3535
97D1A8EB2BA3757700FF1368 /* AWSCognitoAuthPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 97D1A8EA2BA3757700FF1368 /* AWSCognitoAuthPlugin */; };
3636
97D1A8ED2BA3757700FF1368 /* Amplify in Frameworks */ = {isa = PBXBuildFile; productRef = 97D1A8EC2BA3757700FF1368 /* Amplify */; };
37-
97D1A8EF2BA375AA00FF1368 /* amplify-ui-swift-liveness in Resources */ = {isa = PBXBuildFile; fileRef = 97D1A8EE2BA375AA00FF1368 /* amplify-ui-swift-liveness */; };
3837
/* End PBXBuildFile section */
3938

4039
/* Begin PBXContainerItemProxy section */
@@ -336,7 +335,6 @@
336335
files = (
337336
973619262BA378690003A590 /* awsconfiguration.json in Resources */,
338337
9070FFAB285112B5009867D5 /* Preview Assets.xcassets in Resources */,
339-
97D1A8EF2BA375AA00FF1368 /* amplify-ui-swift-liveness in Resources */,
340338
9070FFA8285112B5009867D5 /* Assets.xcassets in Resources */,
341339
973619252BA378690003A590 /* amplifyconfiguration.json in Resources */,
342340
);

HostApp/HostApp/Views/ExampleLivenessView.swift

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -29,27 +29,31 @@ struct ExampleLivenessView: View {
2929
set: { _ in }
3030
),
3131
onCompletion: { result in
32-
switch result {
33-
case .success:
34-
withAnimation { viewModel.presentationState = .result }
35-
case .failure(.sessionNotFound), .failure(.cameraPermissionDenied), .failure(.accessDenied):
36-
viewModel.presentationState = .liveness
37-
isPresented = false
38-
case .failure(.userCancelled):
39-
viewModel.presentationState = .liveness
40-
isPresented = false
41-
case .failure(.sessionTimedOut):
42-
viewModel.presentationState = .error(.sessionTimedOut)
43-
case .failure(.socketClosed):
44-
viewModel.presentationState = .error(.socketClosed)
45-
case .failure(.countdownNoFace), .failure(.countdownFaceTooClose), .failure(.countdownMultipleFaces):
46-
viewModel.presentationState = .error(.countdownFaceTooClose)
47-
case .failure(.invalidSignature):
48-
viewModel.presentationState = .error(.invalidSignature)
49-
case .failure(.invalidCameraPositionSelected):
50-
viewModel.presentationState = .error(.invalidCameraPositionSelected)
51-
default:
52-
viewModel.presentationState = .liveness
32+
DispatchQueue.main.async {
33+
switch result {
34+
case .success:
35+
withAnimation { viewModel.presentationState = .result }
36+
case .failure(.sessionNotFound), .failure(.cameraPermissionDenied), .failure(.accessDenied):
37+
viewModel.presentationState = .liveness
38+
isPresented = false
39+
case .failure(.userCancelled):
40+
viewModel.presentationState = .liveness
41+
isPresented = false
42+
case .failure(.sessionTimedOut):
43+
viewModel.presentationState = .error(.sessionTimedOut)
44+
case .failure(.socketClosed):
45+
viewModel.presentationState = .error(.socketClosed)
46+
case .failure(.countdownNoFace), .failure(.countdownFaceTooClose), .failure(.countdownMultipleFaces):
47+
viewModel.presentationState = .error(.countdownFaceTooClose)
48+
case .failure(.invalidSignature):
49+
viewModel.presentationState = .error(.invalidSignature)
50+
case .failure(.cameraNotAvailable):
51+
viewModel.presentationState = .error(.cameraNotAvailable)
52+
case .failure(.invalidCameraPositionSelected):
53+
viewModel.presentationState = .error(.invalidCameraPositionSelected)
54+
default:
55+
viewModel.presentationState = .liveness
56+
}
5357
}
5458
}
5559
)
@@ -77,6 +81,8 @@ struct ExampleLivenessView: View {
7781
LivenessCheckErrorContentView.failedDuringCountdown
7882
case .invalidSignature:
7983
LivenessCheckErrorContentView.invalidSignature
84+
case .cameraNotAvailable:
85+
LivenessCheckErrorContentView.cameraNotAvailable
8086
case . invalidCameraPositionSelected:
8187
LivenessCheckErrorContentView.invalidCameraPositionSelected
8288
default:

HostApp/HostApp/Views/LivenessCheckErrorContentView.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ extension LivenessCheckErrorContentView {
5555
name: "The signature on the request is invalid.",
5656
description: "Ensure the device time is correct and try again."
5757
)
58+
59+
static let cameraNotAvailable = LivenessCheckErrorContentView(
60+
name: "The camera could not be started.",
61+
description: "There might be a hardware issue with the camera."
62+
)
5863

5964
static let invalidCameraPositionSelected = LivenessCheckErrorContentView(
6065
name: "The camera position selected is incompatible with the liveness challenge type requested.",

Sources/FaceLiveness/AV/VideoChunker.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ final class VideoChunker {
4444
state = .awaitingSingleFrame
4545

4646
// explicitly calling `endSession` is unnecessary
47-
if state != .complete {
47+
if assetWriter.status != .completed {
4848
assetWriter.finishWriting {}
4949
}
5050
}

Sources/FaceLiveness/Utilities/UserAgent.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import InternalAmplifyCredentials
1010

1111
struct UserAgentValues {
1212

13-
static let libVersion = "1.2.15"
13+
static let libVersion = "1.3.2"
1414
static let libName = "amplify-ui-swift-face-liveness"
1515

1616
let amplifyVersion: String

Sources/FaceLiveness/Views/GetReadyPage/ImageFrameView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ struct ImageFrameView: View {
1313
var body: some View {
1414
if let image = image {
1515
GeometryReader { geometry in
16-
Image(decorative: image, scale: 1.0, orientation: .upMirrored)
16+
Image(decorative: image, scale: 1.0, orientation: .up)
1717
.resizable()
1818
.scaledToFill()
1919
.frame(

0 commit comments

Comments
 (0)