aws-amplify / amplify-ui-swift-liveness

This repository offers a UI component for Amazon Rekognition Face Liveness, enabling developers to ensure that only authentic users, and not bad actors using spoofs, can access their services.
https://ui.docs.amplify.aws/swift/connected-components/liveness
Apache License 2.0
9 stars 20 forks source link

fix: resolve race condition when starting AVCaptureSession #93

Closed phantumcode closed 8 months ago

phantumcode commented 9 months ago

Issue #, if available: https://github.com/aws-amplify/amplify-ui-swift-liveness/issues/68 Description of changes: Root cause:

If the liveness check screen and open and dismissed quickly several times, it's possible to run into a race condition wherein the AVCaptureSession.startRunning() while it is being configured which results in the following error

'NSGenericException', reason: '*** -[AVCaptureSession startRunning] startRunning may not be called between calls to beginConfiguration and commitConfiguration'

Resolution:

The requester of the issue was able to test and verify the fix with their Flutter app.

Check points: (check or cross out if not relevant)

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