@aws-amplify/ui-react-liveness@3.6.7
Patch Changes
-
#7005
3e28d0d60c45095e30d31dc39211975ad59cd23dThanks @pranavosu! - fix(react-liveness): add onError handlers and model load timeout to prevent silent stuck statePreviously, if the BlazeFace model or WASM backend failed to load, the
detectFaceservice would throw but the state machine had noonError
handler for thedetectFaceBeforeStart,detectFaceDistanceBeforeRecording,
orinitializeLivenessStreamstates. XState would silently stay stuck in that
state forever without firing theonErrorcallback.Additionally, if the CDN request for model assets stalled without rejecting,
modelLoadingPromisewould hang indefinitely with no timeout.This change:
- Adds
onErrortransitions todetectFaceBeforeStart,
detectFaceDistanceBeforeRecording, andinitializeLivenessStreamstates - Removes the silent catch around
modelLoadingPromiseso model load failures
properly propagate as errors instead of causing a downstream TypeError - Adds a 10s timeout to
triggerModelLoading()so stalled network requests
reject instead of hanging forever
- Adds
-
#7007
6b22524afa8eacaa5bc945418a1a4e89e36da638Thanks @pranavosu! - fix(react-liveness): clear model load timeout timer on rejectionThe model loading timeout introduced previously only cleared the timer
whenloadModels()resolved (via.then()). IfloadModels()rejected
(e.g. a fast CDN failure or WASM compile error), the 10s timer was left
running, leaking until it fired. Switched to.finally()so the timer is
cleared on both resolve and reject paths. -
#7006
87b2e20949e5b8083ef63c11965f1e322f3416d1Thanks @pranavosu! - fix(react-liveness): buffer WebSocket messages to prevent dropped server eventsThe
CustomWebSocketFetchHandlerasync iterator used a singleresolve
function that was initialized as a no-op. If the server sent messages before
the consumer called.next()on the iterator, those messages were silently
dropped. This caused intermittent hangs where theServerSessionInformationEvent
was lost and the state machine polledwaitForSessionInfoforever.This change replaces the single resolve/reject pattern with a proper message
queue that buffers incoming WebSocket messages until the consumer is ready to
receive them.