From 47bfc3ecf3ff704b0fb80e5fac539ce73bea0a6f Mon Sep 17 00:00:00 2001 From: jayce1116 Date: Tue, 23 Apr 2024 16:58:55 +0900 Subject: [PATCH] =?UTF-8?q?ServerInitiatedDirectiveRecevierStateDidChange?= =?UTF-8?q?=EA=B0=80=20=EC=A0=95=ED=99=95=ED=95=98=EA=B2=8C=20=EB=82=B4?= =?UTF-8?q?=EB=A0=A4=EC=98=A4=EC=A7=80=20=EC=95=8A=EB=8D=98=20=EB=AC=B8?= =?UTF-8?q?=EC=A0=9C=20=EC=88=98=EC=A0=95=20(#1155)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ### Description - ServerInitiatedDirectiveRecevierStateDidChange가 정확하게 내려오지 않던 문제 수정 - `startReceiveServerInitiatedDirective`, `stopReceiveServerInitiatedDirective` 를 호출할 때 `unconnected` 혹은 `disconnected` 보다 `serverInitiatedDirectiveStateDisposable` 이 우선적으로 dispose 되고 있어서 state를 정상적으로 수신할 수 없고, NuguClient의 delegate 메서드에서 `unconnected`, `disconnected`를 수신할 수 없었음. --- NuguCore/Sources/StreamData/StreamDataRouter.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/NuguCore/Sources/StreamData/StreamDataRouter.swift b/NuguCore/Sources/StreamData/StreamDataRouter.swift index e8abb370e..58a859064 100644 --- a/NuguCore/Sources/StreamData/StreamDataRouter.swift +++ b/NuguCore/Sources/StreamData/StreamDataRouter.swift @@ -66,6 +66,10 @@ public extension StreamDataRouter { self?.post(state) } + }, onError: { [weak self] error in + self?.post(ServerSentEventReceiverState.disconnected(error: error)) + }, onDisposed: { [weak self] in + self?.post(ServerSentEventReceiverState.unconnected) }) serverInitiatedDirectiveStateDisposable?.disposed(by: disposeBag) @@ -234,6 +238,7 @@ public extension StreamDataRouter { } // MARK: - private + extension StreamDataRouter { /** Send directive or attachment to `DirectiveSequencer` and Call closure