From 784c01ef11f8b31cfa86a46c85499872b8a13c90 Mon Sep 17 00:00:00 2001 From: fredericcarre Date: Mon, 7 Apr 2025 16:16:31 +0200 Subject: [PATCH 1/2] fix snapshot --- src/communication/WebSocketSubscriber.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/communication/WebSocketSubscriber.ts b/src/communication/WebSocketSubscriber.ts index 127bdd4..980a69a 100644 --- a/src/communication/WebSocketSubscriber.ts +++ b/src/communication/WebSocketSubscriber.ts @@ -261,7 +261,10 @@ export class WebSocketSubscriber { let b64Data = JSON.parse(jsonData.JsonMessage).Items; let items; try { - items = JSON.parse(this.deserializer.decodeServerMessage(b64Data)!); + const raw = JSON.parse(this.deserializer.decodeServerMessage(b64Data)!); + if (raw.$values) { + items = raw.$values; + } } catch (e) { items = b64Data; } From b2f52301a5542b5c023e8c1231fb31f3891d5f84 Mon Sep 17 00:00:00 2001 From: fredericcarre Date: Mon, 7 Apr 2025 16:27:48 +0200 Subject: [PATCH 2/2] fix test --- package.json | 2 +- src/communication/WebSocketSubscriber.ts | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 0576fce..4ca0609 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "reactivexcomponent.js", - "version": "7.0.6", + "version": "7.0.7", "description": "Javascript reactive client API for XComponent", "module": "dist/index.js", "main": "dist/index.js", diff --git a/src/communication/WebSocketSubscriber.ts b/src/communication/WebSocketSubscriber.ts index 980a69a..b409048 100644 --- a/src/communication/WebSocketSubscriber.ts +++ b/src/communication/WebSocketSubscriber.ts @@ -265,6 +265,9 @@ export class WebSocketSubscriber { if (raw.$values) { items = raw.$values; } + else { + items = raw; + } } catch (e) { items = b64Data; }