Skip to content

Commit

Permalink
Revert "Revert "chore(liveness): get oval fit timeout from server (#4365
Browse files Browse the repository at this point in the history
)" (#4396)" (#4405)

This reverts commit c70f5a5.
  • Loading branch information
thaddmt authored Aug 31, 2023
1 parent 41a7b42 commit e274c3e
Show file tree
Hide file tree
Showing 4 changed files with 717 additions and 749 deletions.
5 changes: 5 additions & 0 deletions .changeset/ninety-laws-share.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@aws-amplify/ui-react-liveness": patch
---

chore(liveness): get oval fit timeout from server
2 changes: 1 addition & 1 deletion packages/react-liveness/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"dependencies": {
"@aws-amplify/ui": "5.8.0",
"@aws-amplify/ui-react": "5.3.0",
"@aws-sdk/client-rekognitionstreaming": "3.360.0",
"@aws-sdk/client-rekognitionstreaming": "3.398.0",
"@smithy/eventstream-serde-browser": "^2.0.4",
"@tensorflow-models/blazeface": "0.0.7",
"@tensorflow/tfjs-backend-cpu": "3.11.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ import { STATIC_VIDEO_CONSTRAINTS } from '../../StartLiveness/helpers';
import { WS_CLOSURE_CODE } from '../utils/constants';

export const MIN_FACE_MATCH_TIME = 500;
const DEFAULT_FACE_FIT_TIMEOUT = 7000;

// timer metrics variables
let faceDetectedTimestamp: number;
Expand Down Expand Up @@ -675,7 +676,13 @@ export const livenessMachine = createMachine<LivenessContext, LivenessEvent>(
sendTimeoutAfterOvalMatchDelay: actions.send(
{ type: 'TIMEOUT' },
{
delay: 7000,
delay: (context) => {
return (
context.serverSessionInformation?.Challenge
?.FaceMovementAndLightChallenge?.ChallengeConfig
?.OvalFitTimeout || DEFAULT_FACE_FIT_TIMEOUT
);
},
id: 'ovalMatchTimeout',
}
),
Expand Down
Loading

0 comments on commit e274c3e

Please sign in to comment.