Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 22 additions & 22 deletions Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ let package = Package(
targets: ["FaceLiveness"]),
],
dependencies: [
.package(url: "https://github.com/aws-amplify/amplify-swift", from: "2.51.2")
.package(url: "https://github.com/aws-amplify/amplify-swift", branch: "fix/liveness-memory-leaks")
],
targets: [
.target(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
import Foundation

extension FaceLivenessDetectionViewModel: VideoSegmentProcessor {
func process(initalSegment: Data, currentSeparableSegment: Data) {

Check warning on line 11 in Sources/FaceLiveness/Views/Liveness/FaceLivenessDetectionViewModel+VideoSegmentProcessor.swift

View workflow job for this annotation

GitHub Actions / build-amplify-ui-swift-liveness

main actor-isolated instance method 'process(initalSegment:currentSeparableSegment:)' cannot be used to satisfy nonisolated requirement from protocol 'VideoSegmentProcessor'; this is an error in the Swift 6 language mode

Check warning on line 11 in Sources/FaceLiveness/Views/Liveness/FaceLivenessDetectionViewModel+VideoSegmentProcessor.swift

View workflow job for this annotation

GitHub Actions / build-amplify-ui-swift-liveness

main actor-isolated instance method 'process(initalSegment:currentSeparableSegment:)' cannot be used to satisfy nonisolated requirement from protocol 'VideoSegmentProcessor'; this is an error in the Swift 6 language mode

Check warning on line 11 in Sources/FaceLiveness/Views/Liveness/FaceLivenessDetectionViewModel+VideoSegmentProcessor.swift

View workflow job for this annotation

GitHub Actions / Liveness iOS Unit Tests

main actor-isolated instance method 'process(initalSegment:currentSeparableSegment:)' cannot be used to satisfy nonisolated requirement from protocol 'VideoSegmentProcessor'; this is an error in the Swift 6 language mode

Check warning on line 11 in Sources/FaceLiveness/Views/Liveness/FaceLivenessDetectionViewModel+VideoSegmentProcessor.swift

View workflow job for this annotation

GitHub Actions / Liveness iOS Unit Tests

main actor-isolated instance method 'process(initalSegment:currentSeparableSegment:)' cannot be used to satisfy nonisolated requirement from protocol 'VideoSegmentProcessor'; this is an error in the Swift 6 language mode
let chunk = chunk(initial: initalSegment, current: currentSeparableSegment)
sendVideoEvent(data: chunk, videoEventTime: .zero)
if !hasSentFinalVideoEvent &&
(livenessState.state == .completedDisplayingFreshness || livenessState.state == .completedNoLightCheck) {
DispatchQueue.global(qos: .default).asyncAfter(deadline: .now() + 0.9) {
self.sendFinalVideoEvent()
DispatchQueue.global(qos: .default).asyncAfter(deadline: .now() + 0.9) { [weak self] in
self?.sendFinalVideoEvent()

Check warning on line 17 in Sources/FaceLiveness/Views/Liveness/FaceLivenessDetectionViewModel+VideoSegmentProcessor.swift

View workflow job for this annotation

GitHub Actions / build-amplify-ui-swift-liveness

call to main actor-isolated instance method 'sendFinalVideoEvent()' in a synchronous nonisolated context; this is an error in the Swift 6 language mode

Check warning on line 17 in Sources/FaceLiveness/Views/Liveness/FaceLivenessDetectionViewModel+VideoSegmentProcessor.swift

View workflow job for this annotation

GitHub Actions / Liveness iOS Unit Tests

call to main actor-isolated instance method 'sendFinalVideoEvent()' in a synchronous nonisolated context; this is an error in the Swift 6 language mode
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
var hasSentFinalVideoEvent = false
var hasSentFirstVideo = false
var layerRectConverted: (CGRect) -> CGRect = { $0 }
var sessionConfiguration: FaceLivenessSession.SessionConfiguration?

Check warning on line 37 in Sources/FaceLiveness/Views/Liveness/FaceLivenessDetectionViewModel.swift

View workflow job for this annotation

GitHub Actions / build-amplify-ui-swift-liveness

main actor-isolated property 'sessionConfiguration' cannot be used to satisfy nonisolated requirement from protocol 'FaceDetectionSessionConfigurationWrapper'; this is an error in the Swift 6 language mode

Check warning on line 37 in Sources/FaceLiveness/Views/Liveness/FaceLivenessDetectionViewModel.swift

View workflow job for this annotation

GitHub Actions / build-amplify-ui-swift-liveness

main actor-isolated property 'sessionConfiguration' cannot be used to satisfy nonisolated requirement from protocol 'FaceDetectionSessionConfigurationWrapper'; this is an error in the Swift 6 language mode

Check warning on line 37 in Sources/FaceLiveness/Views/Liveness/FaceLivenessDetectionViewModel.swift

View workflow job for this annotation

GitHub Actions / Liveness iOS Unit Tests

main actor-isolated property 'sessionConfiguration' cannot be used to satisfy nonisolated requirement from protocol 'FaceDetectionSessionConfigurationWrapper'; this is an error in the Swift 6 language mode

Check warning on line 37 in Sources/FaceLiveness/Views/Liveness/FaceLivenessDetectionViewModel.swift

View workflow job for this annotation

GitHub Actions / Liveness iOS Unit Tests

main actor-isolated property 'sessionConfiguration' cannot be used to satisfy nonisolated requirement from protocol 'FaceDetectionSessionConfigurationWrapper'; this is an error in the Swift 6 language mode
var challengeReceived: Challenge?
var normalizeFace: (DetectedFace) -> DetectedFace = { $0 }
var provideSingleFrame: ((UIImage) -> Void)?
Expand Down Expand Up @@ -143,9 +143,9 @@

@objc func willResignActive(_ notification: Notification) {
guard self.livenessState.state != .initial else { return }
DispatchQueue.main.async {
self.stopRecording()
self.livenessState.unrecoverableStateEncountered(.viewResignation)
DispatchQueue.main.async { [weak self] in
self?.stopRecording()
self?.livenessState.unrecoverableStateEncountered(.viewResignation)
}
}

Expand All @@ -160,12 +160,13 @@
func configureCamera(withinFrame frame: CGRect) -> CALayer? {
do {
let avLayer = try captureSession?.configureCamera(frame: frame)
DispatchQueue.main.async {
self.livenessState.checkIsFacePrepared()
DispatchQueue.main.async { [weak self] in
self?.livenessState.checkIsFacePrepared()
}
return avLayer
} catch {
DispatchQueue.main.async {
DispatchQueue.main.async { [weak self] in
guard let self else { return }
self.livenessState.unrecoverableStateEncountered(
self.generateLivenessError(from: error)
)
Expand Down Expand Up @@ -203,8 +204,8 @@
)

livenessViewControllerDelegate?.drawOvalInCanvas(normalizedOvalRect)
DispatchQueue.main.async {
self.livenessState.ovalDisplayed()
DispatchQueue.main.async { [weak self] in
self?.livenessState.ovalDisplayed()
onComplete()
}
ovalRect = normalizedOvalRect
Expand All @@ -230,8 +231,8 @@
preCheckViewEnabled: isPreviewScreenEnabled)
)
} catch {
DispatchQueue.main.async {
self.livenessState.unrecoverableStateEncountered(.couldNotOpenStream)
DispatchQueue.main.async { [weak self] in
self?.livenessState.unrecoverableStateEncountered(.couldNotOpenStream)
}
}
}
Expand All @@ -253,8 +254,8 @@
eventDate: { .init() }
)
} catch {
DispatchQueue.main.async {
self.livenessState.unrecoverableStateEncountered(.unknown)
DispatchQueue.main.async { [weak self] in
self?.livenessState.unrecoverableStateEncountered(.unknown)
}
}
}
Expand Down Expand Up @@ -297,8 +298,8 @@
eventDate: { .init() }
)
} catch {
DispatchQueue.main.async {
self.livenessState.unrecoverableStateEncountered(.unknown)
DispatchQueue.main.async { [weak self] in
self?.livenessState.unrecoverableStateEncountered(.unknown)
}
}
}
Expand Down Expand Up @@ -337,8 +338,8 @@
hasSentFinalVideoEvent = true

} catch {
DispatchQueue.main.async {
self.livenessState.unrecoverableStateEncountered(.unknown)
DispatchQueue.main.async { [weak self] in
self?.livenessState.unrecoverableStateEncountered(.unknown)
}
}
}
Expand All @@ -355,14 +356,14 @@
}

func handleFreshnessComplete() {
DispatchQueue.main.async {
self.livenessState.completedDisplayingFreshness()
DispatchQueue.main.async { [weak self] in
self?.livenessState.completedDisplayingFreshness()
}
}

func completeNoLightCheck() {
DispatchQueue.main.async {
self.livenessState.completedNoLightCheck()
DispatchQueue.main.async { [weak self] in
self?.livenessState.completedNoLightCheck()
}
}

Expand All @@ -379,8 +380,8 @@
eventDate: { eventDate }
)
} catch {
DispatchQueue.main.async {
self.livenessState.unrecoverableStateEncountered(.unknown)
DispatchQueue.main.async { [weak self] in
self?.livenessState.unrecoverableStateEncountered(.unknown)
}
}
}
Expand Down
Loading
Loading