From 9fa521ffc9cc6cb9390760f36182db63795e82b6 Mon Sep 17 00:00:00 2001 From: Tuan Pham <103537251+phantumcode@users.noreply.github.com> Date: Tue, 14 May 2024 11:45:09 -0500 Subject: [PATCH] fix(predictions): update liveness websocket send event to be synchronous (#3693) --- .../Liveness/Service/FaceLivenessSession.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AmplifyPlugins/Predictions/AWSPredictionsPlugin/Liveness/Service/FaceLivenessSession.swift b/AmplifyPlugins/Predictions/AWSPredictionsPlugin/Liveness/Service/FaceLivenessSession.swift index fa0ca0df9a..dfd57c1b1b 100644 --- a/AmplifyPlugins/Predictions/AWSPredictionsPlugin/Liveness/Service/FaceLivenessSession.swift +++ b/AmplifyPlugins/Predictions/AWSPredictionsPlugin/Liveness/Service/FaceLivenessSession.swift @@ -84,7 +84,7 @@ public final class FaceLivenessSession: LivenessService { _ event: LivenessEvent, eventDate: @escaping () -> Date = Date.init ) { - livenessServiceDispatchQueue.async { + livenessServiceDispatchQueue.sync { let encodedPayload = self.eventStreamEncoder.encode( payload: event.payload, headers: [