From 1e61d0756b595388db87212dd5a83c3979a48869 Mon Sep 17 00:00:00 2001 From: wgqqqqq Date: Sun, 20 Sep 2026 16:55:55 +0800 Subject: [PATCH] fix(harmonyos): narrow the unsupported-stream error before reporting it `HostSessionStream.catchUp` hands the caught value to `HostSessionCallbacks.onError`, which is typed `(error: Error) => void`. The `HostStreamUnsupportedError` branch passed `error` unchanged and relied on implicit structural assignability, which ArkTS rejects, so `assembleHap` failed on current SDKs: 10605030 ArkTS Compiler Error Structural typing is not supported (arkts-no-structural-typing) At File: entry/src/main/ets/services/HostSessionStream.ets:265:32 The sibling branch two lines below already narrows with `error as Error`. Do the same in the unsupported-stream branch. The reported error, the `close()` that follows, and the retry path are all unchanged. --- .../harmonyos/entry/src/main/ets/services/HostSessionStream.ets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/apps/mobile/harmonyos/entry/src/main/ets/services/HostSessionStream.ets b/src/apps/mobile/harmonyos/entry/src/main/ets/services/HostSessionStream.ets index f8a7855930..9453ace299 100644 --- a/src/apps/mobile/harmonyos/entry/src/main/ets/services/HostSessionStream.ets +++ b/src/apps/mobile/harmonyos/entry/src/main/ets/services/HostSessionStream.ets @@ -262,7 +262,7 @@ export class HostSessionStream { if (error instanceof HostStreamUnsupportedError) { // Nothing on this side can make an older host answer; stop instead of // polling it every 30 seconds. - this.callbacks.onError(error); + this.callbacks.onError(error as Error); this.close(); return; }