@project-chip/matter.js 0.9.2 → 0.9.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/CommissioningServer.d.ts.map +1 -1
- package/dist/cjs/CommissioningServer.js +0 -1
- package/dist/cjs/CommissioningServer.js.map +2 -2
- package/dist/cjs/MatterDevice.d.ts +3 -0
- package/dist/cjs/MatterDevice.d.ts.map +1 -1
- package/dist/cjs/MatterDevice.js +21 -7
- package/dist/cjs/MatterDevice.js.map +2 -2
- package/dist/cjs/behavior/AccessControl.js +2 -2
- package/dist/cjs/behavior/AccessControl.js.map +2 -2
- package/dist/cjs/behavior/definitions/general-commissioning/ServerNodeFailsafeContext.d.ts +1 -0
- package/dist/cjs/behavior/definitions/general-commissioning/ServerNodeFailsafeContext.d.ts.map +1 -1
- package/dist/cjs/behavior/definitions/general-commissioning/ServerNodeFailsafeContext.js +14 -0
- package/dist/cjs/behavior/definitions/general-commissioning/ServerNodeFailsafeContext.js.map +2 -2
- package/dist/cjs/behavior/definitions/operational-credentials/OperationalCredentialsServer.d.ts.map +1 -1
- package/dist/cjs/behavior/definitions/operational-credentials/OperationalCredentialsServer.js +11 -2
- package/dist/cjs/behavior/definitions/operational-credentials/OperationalCredentialsServer.js.map +2 -2
- package/dist/cjs/behavior/state/transaction/Transaction.d.ts +18 -18
- package/dist/cjs/certificate/CertificateManager.d.ts.map +1 -1
- package/dist/cjs/certificate/CertificateManager.js +1 -0
- package/dist/cjs/certificate/CertificateManager.js.map +2 -2
- package/dist/cjs/certificate/CertificationDeclarationManager.d.ts +1 -1
- package/dist/cjs/certificate/CertificationDeclarationManager.d.ts.map +1 -1
- package/dist/cjs/certificate/CertificationDeclarationManager.js +3 -2
- package/dist/cjs/certificate/CertificationDeclarationManager.js.map +2 -2
- package/dist/cjs/cluster/server/AccessControlServer.js.map +1 -1
- package/dist/cjs/cluster/server/AttributeServer.d.ts +9 -0
- package/dist/cjs/cluster/server/AttributeServer.d.ts.map +1 -1
- package/dist/cjs/cluster/server/AttributeServer.js +62 -0
- package/dist/cjs/cluster/server/AttributeServer.js.map +3 -3
- package/dist/cjs/cluster/server/ClusterServer.d.ts.map +1 -1
- package/dist/cjs/cluster/server/ClusterServer.js +8 -1
- package/dist/cjs/cluster/server/ClusterServer.js.map +2 -2
- package/dist/cjs/cluster/server/ClusterServerTypes.d.ts +3 -3
- package/dist/cjs/cluster/server/ClusterServerTypes.d.ts.map +1 -1
- package/dist/cjs/cluster/server/ClusterServerTypes.js.map +1 -1
- package/dist/cjs/cluster/server/EventServer.d.ts +8 -2
- package/dist/cjs/cluster/server/EventServer.d.ts.map +1 -1
- package/dist/cjs/cluster/server/EventServer.js +33 -7
- package/dist/cjs/cluster/server/EventServer.js.map +2 -2
- package/dist/cjs/cluster/server/OperationalCredentialsServer.d.ts.map +1 -1
- package/dist/cjs/cluster/server/OperationalCredentialsServer.js +31 -8
- package/dist/cjs/cluster/server/OperationalCredentialsServer.js.map +2 -2
- package/dist/cjs/common/FailsafeContext.d.ts +1 -0
- package/dist/cjs/common/FailsafeContext.d.ts.map +1 -1
- package/dist/cjs/common/FailsafeContext.js +16 -2
- package/dist/cjs/common/FailsafeContext.js.map +2 -2
- package/dist/cjs/crypto/Crypto.d.ts +1 -1
- package/dist/cjs/crypto/Crypto.d.ts.map +1 -1
- package/dist/cjs/crypto/Crypto.js +2 -2
- package/dist/cjs/crypto/Crypto.js.map +2 -2
- package/dist/cjs/device/LegacyInteractionServer.d.ts +2 -2
- package/dist/cjs/device/LegacyInteractionServer.d.ts.map +1 -1
- package/dist/cjs/device/LegacyInteractionServer.js +13 -1
- package/dist/cjs/device/LegacyInteractionServer.js.map +2 -2
- package/dist/cjs/fabric/Fabric.d.ts +1 -0
- package/dist/cjs/fabric/Fabric.d.ts.map +1 -1
- package/dist/cjs/fabric/Fabric.js +5 -0
- package/dist/cjs/fabric/Fabric.js.map +2 -2
- package/dist/cjs/fabric/FabricManager.d.ts +1 -0
- package/dist/cjs/fabric/FabricManager.d.ts.map +1 -1
- package/dist/cjs/fabric/FabricManager.js +2 -1
- package/dist/cjs/fabric/FabricManager.js.map +2 -2
- package/dist/cjs/model/models/EventModel.d.ts +1 -0
- package/dist/cjs/model/models/EventModel.d.ts.map +1 -1
- package/dist/cjs/model/models/EventModel.js +3 -0
- package/dist/cjs/model/models/EventModel.js.map +2 -2
- package/dist/cjs/model/models/FieldModel.d.ts +1 -0
- package/dist/cjs/model/models/FieldModel.d.ts.map +1 -1
- package/dist/cjs/model/models/FieldModel.js +3 -0
- package/dist/cjs/model/models/FieldModel.js.map +2 -2
- package/dist/cjs/node/server/TransactionalInteractionServer.d.ts +2 -2
- package/dist/cjs/node/server/TransactionalInteractionServer.d.ts.map +1 -1
- package/dist/cjs/node/server/TransactionalInteractionServer.js +0 -2
- package/dist/cjs/node/server/TransactionalInteractionServer.js.map +2 -2
- package/dist/cjs/protocol/interaction/AttributeDataEncoder.d.ts +6 -3
- package/dist/cjs/protocol/interaction/AttributeDataEncoder.d.ts.map +1 -1
- package/dist/cjs/protocol/interaction/AttributeDataEncoder.js +14 -8
- package/dist/cjs/protocol/interaction/AttributeDataEncoder.js.map +2 -2
- package/dist/cjs/protocol/interaction/EventHandler.d.ts.map +1 -1
- package/dist/cjs/protocol/interaction/EventHandler.js +1 -3
- package/dist/cjs/protocol/interaction/EventHandler.js.map +2 -2
- package/dist/cjs/protocol/interaction/InteractionClient.js +1 -1
- package/dist/cjs/protocol/interaction/InteractionClient.js.map +2 -2
- package/dist/cjs/protocol/interaction/InteractionEndpointStructure.d.ts +3 -3
- package/dist/cjs/protocol/interaction/InteractionEndpointStructure.d.ts.map +1 -1
- package/dist/cjs/protocol/interaction/InteractionEndpointStructure.js +1 -0
- package/dist/cjs/protocol/interaction/InteractionEndpointStructure.js.map +2 -2
- package/dist/cjs/protocol/interaction/InteractionMessenger.d.ts +1 -1
- package/dist/cjs/protocol/interaction/InteractionMessenger.d.ts.map +1 -1
- package/dist/cjs/protocol/interaction/InteractionMessenger.js +11 -4
- package/dist/cjs/protocol/interaction/InteractionMessenger.js.map +2 -2
- package/dist/cjs/protocol/interaction/InteractionServer.d.ts +5 -6
- package/dist/cjs/protocol/interaction/InteractionServer.d.ts.map +1 -1
- package/dist/cjs/protocol/interaction/InteractionServer.js +44 -37
- package/dist/cjs/protocol/interaction/InteractionServer.js.map +2 -2
- package/dist/cjs/protocol/interaction/SubscriptionHandler.d.ts +31 -12
- package/dist/cjs/protocol/interaction/SubscriptionHandler.d.ts.map +1 -1
- package/dist/cjs/protocol/interaction/SubscriptionHandler.js +161 -69
- package/dist/cjs/protocol/interaction/SubscriptionHandler.js.map +3 -3
- package/dist/cjs/session/SecureSession.d.ts.map +1 -1
- package/dist/cjs/session/SecureSession.js +2 -1
- package/dist/cjs/session/SecureSession.js.map +2 -2
- package/dist/cjs/session/SessionManager.d.ts +2 -0
- package/dist/cjs/session/SessionManager.d.ts.map +1 -1
- package/dist/cjs/session/SessionManager.js +7 -0
- package/dist/cjs/session/SessionManager.js.map +2 -2
- package/dist/cjs/tlv/TlvArray.d.ts +2 -2
- package/dist/cjs/tlv/TlvArray.d.ts.map +1 -1
- package/dist/cjs/tlv/TlvArray.js +2 -2
- package/dist/cjs/tlv/TlvArray.js.map +2 -2
- package/dist/cjs/tlv/TlvNullable.d.ts +2 -2
- package/dist/cjs/tlv/TlvNullable.d.ts.map +1 -1
- package/dist/cjs/tlv/TlvNullable.js +2 -2
- package/dist/cjs/tlv/TlvNullable.js.map +2 -2
- package/dist/cjs/tlv/TlvObject.d.ts +2 -2
- package/dist/cjs/tlv/TlvObject.d.ts.map +1 -1
- package/dist/cjs/tlv/TlvObject.js +18 -12
- package/dist/cjs/tlv/TlvObject.js.map +2 -2
- package/dist/cjs/tlv/TlvSchema.d.ts +14 -2
- package/dist/cjs/tlv/TlvSchema.d.ts.map +1 -1
- package/dist/cjs/tlv/TlvSchema.js +2 -2
- package/dist/cjs/tlv/TlvSchema.js.map +2 -2
- package/dist/cjs/tlv/TlvWrapper.d.ts +2 -2
- package/dist/cjs/tlv/TlvWrapper.d.ts.map +1 -1
- package/dist/cjs/tlv/TlvWrapper.js +2 -2
- package/dist/cjs/tlv/TlvWrapper.js.map +2 -2
- package/dist/esm/CommissioningServer.d.ts.map +1 -1
- package/dist/esm/CommissioningServer.js +0 -1
- package/dist/esm/CommissioningServer.js.map +2 -2
- package/dist/esm/MatterDevice.d.ts +3 -0
- package/dist/esm/MatterDevice.d.ts.map +1 -1
- package/dist/esm/MatterDevice.js +21 -7
- package/dist/esm/MatterDevice.js.map +2 -2
- package/dist/esm/behavior/AccessControl.js +2 -2
- package/dist/esm/behavior/AccessControl.js.map +2 -2
- package/dist/esm/behavior/definitions/general-commissioning/ServerNodeFailsafeContext.d.ts +1 -0
- package/dist/esm/behavior/definitions/general-commissioning/ServerNodeFailsafeContext.d.ts.map +1 -1
- package/dist/esm/behavior/definitions/general-commissioning/ServerNodeFailsafeContext.js +15 -1
- package/dist/esm/behavior/definitions/general-commissioning/ServerNodeFailsafeContext.js.map +2 -2
- package/dist/esm/behavior/definitions/operational-credentials/OperationalCredentialsServer.d.ts.map +1 -1
- package/dist/esm/behavior/definitions/operational-credentials/OperationalCredentialsServer.js +11 -2
- package/dist/esm/behavior/definitions/operational-credentials/OperationalCredentialsServer.js.map +2 -2
- package/dist/esm/behavior/state/transaction/Transaction.d.ts +18 -18
- package/dist/esm/certificate/CertificateManager.d.ts.map +1 -1
- package/dist/esm/certificate/CertificateManager.js +1 -0
- package/dist/esm/certificate/CertificateManager.js.map +2 -2
- package/dist/esm/certificate/CertificationDeclarationManager.d.ts +1 -1
- package/dist/esm/certificate/CertificationDeclarationManager.d.ts.map +1 -1
- package/dist/esm/certificate/CertificationDeclarationManager.js +3 -2
- package/dist/esm/certificate/CertificationDeclarationManager.js.map +2 -2
- package/dist/esm/cluster/server/AccessControlServer.js.map +1 -1
- package/dist/esm/cluster/server/AttributeServer.d.ts +9 -0
- package/dist/esm/cluster/server/AttributeServer.d.ts.map +1 -1
- package/dist/esm/cluster/server/AttributeServer.js +69 -1
- package/dist/esm/cluster/server/AttributeServer.js.map +2 -2
- package/dist/esm/cluster/server/ClusterServer.d.ts.map +1 -1
- package/dist/esm/cluster/server/ClusterServer.js +9 -2
- package/dist/esm/cluster/server/ClusterServer.js.map +2 -2
- package/dist/esm/cluster/server/ClusterServerTypes.d.ts +3 -3
- package/dist/esm/cluster/server/ClusterServerTypes.d.ts.map +1 -1
- package/dist/esm/cluster/server/ClusterServerTypes.js.map +1 -1
- package/dist/esm/cluster/server/EventServer.d.ts +8 -2
- package/dist/esm/cluster/server/EventServer.d.ts.map +1 -1
- package/dist/esm/cluster/server/EventServer.js +33 -7
- package/dist/esm/cluster/server/EventServer.js.map +2 -2
- package/dist/esm/cluster/server/OperationalCredentialsServer.d.ts.map +1 -1
- package/dist/esm/cluster/server/OperationalCredentialsServer.js +31 -8
- package/dist/esm/cluster/server/OperationalCredentialsServer.js.map +2 -2
- package/dist/esm/common/FailsafeContext.d.ts +1 -0
- package/dist/esm/common/FailsafeContext.d.ts.map +1 -1
- package/dist/esm/common/FailsafeContext.js +17 -3
- package/dist/esm/common/FailsafeContext.js.map +2 -2
- package/dist/esm/crypto/Crypto.d.ts +1 -1
- package/dist/esm/crypto/Crypto.d.ts.map +1 -1
- package/dist/esm/crypto/Crypto.js +2 -2
- package/dist/esm/crypto/Crypto.js.map +2 -2
- package/dist/esm/device/LegacyInteractionServer.d.ts +2 -2
- package/dist/esm/device/LegacyInteractionServer.d.ts.map +1 -1
- package/dist/esm/device/LegacyInteractionServer.js +13 -1
- package/dist/esm/device/LegacyInteractionServer.js.map +2 -2
- package/dist/esm/fabric/Fabric.d.ts +1 -0
- package/dist/esm/fabric/Fabric.d.ts.map +1 -1
- package/dist/esm/fabric/Fabric.js +5 -0
- package/dist/esm/fabric/Fabric.js.map +2 -2
- package/dist/esm/fabric/FabricManager.d.ts +1 -0
- package/dist/esm/fabric/FabricManager.d.ts.map +1 -1
- package/dist/esm/fabric/FabricManager.js +2 -1
- package/dist/esm/fabric/FabricManager.js.map +2 -2
- package/dist/esm/model/models/EventModel.d.ts +1 -0
- package/dist/esm/model/models/EventModel.d.ts.map +1 -1
- package/dist/esm/model/models/EventModel.js +3 -0
- package/dist/esm/model/models/EventModel.js.map +2 -2
- package/dist/esm/model/models/FieldModel.d.ts +1 -0
- package/dist/esm/model/models/FieldModel.d.ts.map +1 -1
- package/dist/esm/model/models/FieldModel.js +3 -0
- package/dist/esm/model/models/FieldModel.js.map +2 -2
- package/dist/esm/node/server/TransactionalInteractionServer.d.ts +2 -2
- package/dist/esm/node/server/TransactionalInteractionServer.d.ts.map +1 -1
- package/dist/esm/node/server/TransactionalInteractionServer.js +0 -2
- package/dist/esm/node/server/TransactionalInteractionServer.js.map +2 -2
- package/dist/esm/protocol/interaction/AttributeDataEncoder.d.ts +6 -3
- package/dist/esm/protocol/interaction/AttributeDataEncoder.d.ts.map +1 -1
- package/dist/esm/protocol/interaction/AttributeDataEncoder.js +14 -8
- package/dist/esm/protocol/interaction/AttributeDataEncoder.js.map +2 -2
- package/dist/esm/protocol/interaction/EventHandler.d.ts.map +1 -1
- package/dist/esm/protocol/interaction/EventHandler.js +1 -3
- package/dist/esm/protocol/interaction/EventHandler.js.map +2 -2
- package/dist/esm/protocol/interaction/InteractionClient.js +1 -1
- package/dist/esm/protocol/interaction/InteractionClient.js.map +2 -2
- package/dist/esm/protocol/interaction/InteractionEndpointStructure.d.ts +3 -3
- package/dist/esm/protocol/interaction/InteractionEndpointStructure.d.ts.map +1 -1
- package/dist/esm/protocol/interaction/InteractionEndpointStructure.js +1 -0
- package/dist/esm/protocol/interaction/InteractionEndpointStructure.js.map +2 -2
- package/dist/esm/protocol/interaction/InteractionMessenger.d.ts +1 -1
- package/dist/esm/protocol/interaction/InteractionMessenger.d.ts.map +1 -1
- package/dist/esm/protocol/interaction/InteractionMessenger.js +11 -4
- package/dist/esm/protocol/interaction/InteractionMessenger.js.map +2 -2
- package/dist/esm/protocol/interaction/InteractionServer.d.ts +5 -6
- package/dist/esm/protocol/interaction/InteractionServer.d.ts.map +1 -1
- package/dist/esm/protocol/interaction/InteractionServer.js +44 -37
- package/dist/esm/protocol/interaction/InteractionServer.js.map +2 -2
- package/dist/esm/protocol/interaction/SubscriptionHandler.d.ts +31 -12
- package/dist/esm/protocol/interaction/SubscriptionHandler.d.ts.map +1 -1
- package/dist/esm/protocol/interaction/SubscriptionHandler.js +161 -69
- package/dist/esm/protocol/interaction/SubscriptionHandler.js.map +3 -3
- package/dist/esm/session/SecureSession.d.ts.map +1 -1
- package/dist/esm/session/SecureSession.js +2 -1
- package/dist/esm/session/SecureSession.js.map +2 -2
- package/dist/esm/session/SessionManager.d.ts +2 -0
- package/dist/esm/session/SessionManager.d.ts.map +1 -1
- package/dist/esm/session/SessionManager.js +7 -0
- package/dist/esm/session/SessionManager.js.map +2 -2
- package/dist/esm/tlv/TlvArray.d.ts +2 -2
- package/dist/esm/tlv/TlvArray.d.ts.map +1 -1
- package/dist/esm/tlv/TlvArray.js +2 -2
- package/dist/esm/tlv/TlvArray.js.map +2 -2
- package/dist/esm/tlv/TlvNullable.d.ts +2 -2
- package/dist/esm/tlv/TlvNullable.d.ts.map +1 -1
- package/dist/esm/tlv/TlvNullable.js +2 -2
- package/dist/esm/tlv/TlvNullable.js.map +2 -2
- package/dist/esm/tlv/TlvObject.d.ts +2 -2
- package/dist/esm/tlv/TlvObject.d.ts.map +1 -1
- package/dist/esm/tlv/TlvObject.js +19 -13
- package/dist/esm/tlv/TlvObject.js.map +2 -2
- package/dist/esm/tlv/TlvSchema.d.ts +14 -2
- package/dist/esm/tlv/TlvSchema.d.ts.map +1 -1
- package/dist/esm/tlv/TlvSchema.js +2 -2
- package/dist/esm/tlv/TlvSchema.js.map +2 -2
- package/dist/esm/tlv/TlvWrapper.d.ts +2 -2
- package/dist/esm/tlv/TlvWrapper.d.ts.map +1 -1
- package/dist/esm/tlv/TlvWrapper.js +2 -2
- package/dist/esm/tlv/TlvWrapper.js.map +2 -2
- package/package.json +3 -3
- package/src/CommissioningServer.ts +0 -1
- package/src/MatterDevice.ts +34 -7
- package/src/behavior/AccessControl.ts +2 -2
- package/src/behavior/definitions/general-commissioning/ServerNodeFailsafeContext.ts +21 -1
- package/src/behavior/definitions/operational-credentials/OperationalCredentialsServer.ts +13 -0
- package/src/certificate/CertificateManager.ts +1 -2
- package/src/certificate/CertificationDeclarationManager.ts +2 -2
- package/src/cluster/server/AccessControlServer.ts +3 -3
- package/src/cluster/server/AttributeServer.ts +79 -1
- package/src/cluster/server/ClusterServer.ts +9 -2
- package/src/cluster/server/ClusterServerTypes.ts +3 -3
- package/src/cluster/server/EventServer.ts +57 -10
- package/src/cluster/server/OperationalCredentialsServer.ts +35 -5
- package/src/common/FailsafeContext.ts +19 -7
- package/src/crypto/Crypto.ts +1 -1
- package/src/device/LegacyInteractionServer.ts +15 -4
- package/src/fabric/Fabric.ts +6 -0
- package/src/fabric/FabricManager.ts +1 -0
- package/src/model/models/EventModel.ts +4 -0
- package/src/model/models/FieldModel.ts +4 -0
- package/src/node/server/TransactionalInteractionServer.ts +2 -4
- package/src/protocol/interaction/AttributeDataEncoder.ts +20 -9
- package/src/protocol/interaction/EventHandler.ts +1 -3
- package/src/protocol/interaction/InteractionClient.ts +1 -1
- package/src/protocol/interaction/InteractionEndpointStructure.ts +4 -4
- package/src/protocol/interaction/InteractionMessenger.ts +12 -3
- package/src/protocol/interaction/InteractionServer.ts +53 -52
- package/src/protocol/interaction/SubscriptionHandler.ts +215 -92
- package/src/session/SecureSession.ts +2 -1
- package/src/session/SessionManager.ts +9 -0
- package/src/tlv/TlvArray.ts +3 -3
- package/src/tlv/TlvNullable.ts +3 -3
- package/src/tlv/TlvObject.ts +20 -14
- package/src/tlv/TlvSchema.ts +17 -3
- package/src/tlv/TlvWrapper.ts +3 -3
|
@@ -4,12 +4,15 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import { FabricScopedAttributeServer } from "../../cluster/server/AttributeServer.js";
|
|
7
|
+
import { FabricSensitiveEventServer } from "../../cluster/server/EventServer.js";
|
|
7
8
|
import { InternalError } from "../../common/MatterError.js";
|
|
8
9
|
import { tryCatch, tryCatchAsync } from "../../common/TryCatchHandler.js";
|
|
9
10
|
import { EventNumber } from "../../datatype/EventNumber.js";
|
|
10
11
|
import { Logger } from "../../log/Logger.js";
|
|
11
12
|
import { NetworkError } from "../../net/Network.js";
|
|
12
13
|
import { Time } from "../../time/Time.js";
|
|
14
|
+
import { MaybePromise } from "../../util/Promises.js";
|
|
15
|
+
import { isObject } from "../../util/Type.js";
|
|
13
16
|
import { RetransmissionLimitReachedError } from "../MessageExchange.js";
|
|
14
17
|
import { InteractionServerMessenger } from "./InteractionMessenger.js";
|
|
15
18
|
import {
|
|
@@ -22,17 +25,7 @@ import {
|
|
|
22
25
|
import { StatusCode, StatusResponseError } from "./StatusCode.js";
|
|
23
26
|
const logger = Logger.get("SubscriptionHandler");
|
|
24
27
|
class SubscriptionHandler {
|
|
25
|
-
constructor(
|
|
26
|
-
this.subscriptionId = subscriptionId;
|
|
27
|
-
this.session = session;
|
|
28
|
-
this.endpointStructure = endpointStructure;
|
|
29
|
-
this.attributeRequests = attributeRequests;
|
|
30
|
-
this.dataVersionFilters = dataVersionFilters;
|
|
31
|
-
this.eventRequests = eventRequests;
|
|
32
|
-
this.eventFilters = eventFilters;
|
|
33
|
-
this.eventHandler = eventHandler;
|
|
34
|
-
this.isFabricFiltered = isFabricFiltered;
|
|
35
|
-
this.cancelCallback = cancelCallback;
|
|
28
|
+
constructor(options) {
|
|
36
29
|
this.lastUpdateTimeMs = 0;
|
|
37
30
|
this.outstandingAttributeUpdates = /* @__PURE__ */ new Map();
|
|
38
31
|
this.outstandingEventUpdates = /* @__PURE__ */ new Set();
|
|
@@ -42,6 +35,32 @@ class SubscriptionHandler {
|
|
|
42
35
|
this.sendingUpdateInProgress = false;
|
|
43
36
|
this.sendNextUpdateImmediately = false;
|
|
44
37
|
this.sendUpdateErrorCounter = 0;
|
|
38
|
+
this.attributeUpdatePromises = /* @__PURE__ */ new Set();
|
|
39
|
+
const {
|
|
40
|
+
subscriptionId,
|
|
41
|
+
session,
|
|
42
|
+
endpointStructure,
|
|
43
|
+
attributeRequests,
|
|
44
|
+
dataVersionFilters,
|
|
45
|
+
eventRequests,
|
|
46
|
+
eventFilters,
|
|
47
|
+
isFabricFiltered,
|
|
48
|
+
minIntervalFloor,
|
|
49
|
+
maxIntervalCeiling,
|
|
50
|
+
cancelCallback,
|
|
51
|
+
subscriptionOptions
|
|
52
|
+
} = options;
|
|
53
|
+
this.subscriptionId = subscriptionId;
|
|
54
|
+
this.session = session;
|
|
55
|
+
this.endpointStructure = endpointStructure;
|
|
56
|
+
this.attributeRequests = attributeRequests;
|
|
57
|
+
this.dataVersionFilters = dataVersionFilters;
|
|
58
|
+
this.eventRequests = eventRequests;
|
|
59
|
+
this.eventFilters = eventFilters;
|
|
60
|
+
this.isFabricFiltered = isFabricFiltered;
|
|
61
|
+
this.cancelCallback = cancelCallback;
|
|
62
|
+
this.readAttribute = options.readAttribute;
|
|
63
|
+
this.readEvent = options.readEvent;
|
|
45
64
|
this.server = this.session.context;
|
|
46
65
|
this.fabric = this.session.associatedFabric;
|
|
47
66
|
this.peerNodeId = this.session.peerNodeId;
|
|
@@ -241,11 +260,12 @@ class SubscriptionHandler {
|
|
|
241
260
|
* Newly added attributes are then treated ad "changed values" and will be sent as subscription data update to the
|
|
242
261
|
* controller. The data of newly added events are not sent automatically.
|
|
243
262
|
*/
|
|
244
|
-
updateSubscription() {
|
|
263
|
+
async updateSubscription() {
|
|
245
264
|
const { newAttributes } = this.registerNewAttributes();
|
|
246
265
|
for (const { path, attribute } of newAttributes) {
|
|
247
|
-
const { version, value } =
|
|
266
|
+
const { version, value } = await this.readAttribute(path, attribute);
|
|
248
267
|
this.outstandingAttributeUpdates.set(attributePathToId(path), {
|
|
268
|
+
attribute,
|
|
249
269
|
path,
|
|
250
270
|
schema: attribute.schema,
|
|
251
271
|
version,
|
|
@@ -253,16 +273,18 @@ class SubscriptionHandler {
|
|
|
253
273
|
});
|
|
254
274
|
}
|
|
255
275
|
const { newEvents } = this.registerNewEvents();
|
|
256
|
-
newEvents.flatMap(({ path, event
|
|
257
|
-
const
|
|
258
|
-
|
|
276
|
+
newEvents.flatMap(({ path, event }) => {
|
|
277
|
+
const { schema } = event;
|
|
278
|
+
const matchingEvents = event.get(this.session, this.isFabricFiltered, void 0, this.eventFilters);
|
|
279
|
+
return matchingEvents.map((data) => ({
|
|
280
|
+
event,
|
|
259
281
|
schema,
|
|
260
282
|
path,
|
|
261
|
-
|
|
283
|
+
data
|
|
262
284
|
}));
|
|
263
285
|
}).sort((a, b) => {
|
|
264
|
-
const eventNumberA = a.
|
|
265
|
-
const eventNumberB = b.
|
|
286
|
+
const eventNumberA = a.data?.eventNumber ?? EventNumber(0);
|
|
287
|
+
const eventNumberB = b.data?.eventNumber ?? EventNumber(0);
|
|
266
288
|
if (eventNumberA > eventNumberB) {
|
|
267
289
|
return 1;
|
|
268
290
|
} else if (eventNumberA < eventNumberB) {
|
|
@@ -330,8 +352,22 @@ class SubscriptionHandler {
|
|
|
330
352
|
this.sendNextUpdateImmediately = true;
|
|
331
353
|
return;
|
|
332
354
|
}
|
|
333
|
-
const attributeUpdatesToSend = Array
|
|
355
|
+
const attributeUpdatesToSend = new Array();
|
|
356
|
+
const attributeUpdates = {};
|
|
357
|
+
Array.from(this.outstandingAttributeUpdates.values()).forEach((entry) => {
|
|
358
|
+
const {
|
|
359
|
+
path: { nodeId, endpointId, clusterId }
|
|
360
|
+
} = entry;
|
|
361
|
+
const pathId = `${nodeId}-${endpointId}-${clusterId}`;
|
|
362
|
+
attributeUpdates[pathId] = attributeUpdates[pathId] ?? [];
|
|
363
|
+
attributeUpdates[pathId].push(entry);
|
|
364
|
+
});
|
|
334
365
|
this.outstandingAttributeUpdates.clear();
|
|
366
|
+
Object.values(attributeUpdates).forEach(
|
|
367
|
+
(data) => attributeUpdatesToSend.push(
|
|
368
|
+
...data.sort(({ version: versionA }, { version: versionB }) => versionA - versionB)
|
|
369
|
+
)
|
|
370
|
+
);
|
|
335
371
|
const eventUpdatesToSend = Array.from(this.outstandingEventUpdates.values());
|
|
336
372
|
this.outstandingEventUpdates.clear();
|
|
337
373
|
this.lastUpdateTimeMs = Time.nowMs();
|
|
@@ -367,7 +403,7 @@ class SubscriptionHandler {
|
|
|
367
403
|
await this.sendUpdate();
|
|
368
404
|
}
|
|
369
405
|
}
|
|
370
|
-
async sendInitialReport(messenger
|
|
406
|
+
async sendInitialReport(messenger) {
|
|
371
407
|
this.updateTimer.stop();
|
|
372
408
|
const { newAttributes, attributeErrors } = this.registerNewAttributes();
|
|
373
409
|
const dataVersionFilterMap = new Map(
|
|
@@ -377,7 +413,7 @@ class SubscriptionHandler {
|
|
|
377
413
|
const attributes = new Array();
|
|
378
414
|
for (const { path, attribute } of newAttributes) {
|
|
379
415
|
try {
|
|
380
|
-
const { value, version } = await readAttribute(path, attribute);
|
|
416
|
+
const { value, version } = await this.readAttribute(path, attribute);
|
|
381
417
|
if (value === void 0) continue;
|
|
382
418
|
const { nodeId, endpointId, clusterId } = path;
|
|
383
419
|
const versionFilterValue = endpointId !== void 0 && clusterId !== void 0 ? dataVersionFilterMap.get(clusterPathToId({ nodeId, endpointId, clusterId })) : void 0;
|
|
@@ -385,13 +421,14 @@ class SubscriptionHandler {
|
|
|
385
421
|
attributesFilteredWithVersion = true;
|
|
386
422
|
continue;
|
|
387
423
|
}
|
|
388
|
-
attributes.push({ path, value, version, schema: attribute.schema });
|
|
424
|
+
attributes.push({ path, value, version, schema: attribute.schema, attribute });
|
|
389
425
|
} catch (error) {
|
|
390
426
|
logger.error(`Error reading attribute ${this.endpointStructure.resolveAttributeName(path)}:`, error);
|
|
391
427
|
}
|
|
392
428
|
}
|
|
393
429
|
const attributeReportsPayload = attributes.map(
|
|
394
|
-
({ path, schema, value, version }) => ({
|
|
430
|
+
({ path, schema, value, version, attribute }) => ({
|
|
431
|
+
hasFabricSensitiveData: attribute.hasFabricSensitiveData,
|
|
395
432
|
attributeData: {
|
|
396
433
|
path,
|
|
397
434
|
dataVersion: version,
|
|
@@ -400,19 +437,25 @@ class SubscriptionHandler {
|
|
|
400
437
|
}
|
|
401
438
|
})
|
|
402
439
|
);
|
|
403
|
-
attributeErrors.forEach(
|
|
440
|
+
attributeErrors.forEach(
|
|
441
|
+
(attributeStatus) => attributeReportsPayload.push({
|
|
442
|
+
hasFabricSensitiveData: false,
|
|
443
|
+
attributeStatus
|
|
444
|
+
})
|
|
445
|
+
);
|
|
404
446
|
const { newEvents, eventErrors } = this.registerNewEvents();
|
|
405
447
|
let eventsFiltered = false;
|
|
406
448
|
const eventReportsPayload = new Array();
|
|
407
449
|
for (const { path, event } of newEvents) {
|
|
408
450
|
const { schema } = event;
|
|
409
451
|
try {
|
|
410
|
-
const matchingEvents = await readEvent(path, event, this.eventFilters);
|
|
452
|
+
const matchingEvents = await this.readEvent(path, event, this.eventFilters);
|
|
411
453
|
if (matchingEvents.length === 0) {
|
|
412
454
|
eventsFiltered = true;
|
|
413
455
|
} else {
|
|
414
456
|
matchingEvents.forEach(({ eventNumber, priority, epochTimestamp, data }) => {
|
|
415
457
|
eventReportsPayload.push({
|
|
458
|
+
hasFabricSensitiveData: event.hasFabricSensitiveData,
|
|
416
459
|
eventData: {
|
|
417
460
|
path,
|
|
418
461
|
eventNumber,
|
|
@@ -445,32 +488,65 @@ class SubscriptionHandler {
|
|
|
445
488
|
StatusCode.InvalidAction
|
|
446
489
|
);
|
|
447
490
|
}
|
|
448
|
-
eventErrors.forEach(
|
|
491
|
+
eventErrors.forEach(
|
|
492
|
+
(eventStatus) => eventReportsPayload.push({
|
|
493
|
+
hasFabricSensitiveData: false,
|
|
494
|
+
eventStatus
|
|
495
|
+
})
|
|
496
|
+
);
|
|
449
497
|
logger.debug(
|
|
450
498
|
`Initialize Subscription with ${attributes.length} attributes and ${eventReportsPayload.length} events.`
|
|
451
499
|
);
|
|
452
500
|
this.lastUpdateTimeMs = Time.nowMs();
|
|
453
|
-
await messenger.sendDataReport(
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
501
|
+
await messenger.sendDataReport(
|
|
502
|
+
{
|
|
503
|
+
suppressResponse: false,
|
|
504
|
+
subscriptionId: this.subscriptionId,
|
|
505
|
+
interactionModelRevision: INTERACTION_MODEL_REVISION,
|
|
506
|
+
attributeReportsPayload,
|
|
507
|
+
// TODO Return compressed response once https://github.com/project-chip/connectedhomeip/issues/29359 is solved
|
|
508
|
+
eventReportsPayload
|
|
509
|
+
},
|
|
510
|
+
this.isFabricFiltered
|
|
511
|
+
);
|
|
461
512
|
}
|
|
462
513
|
attributeChangeListener(path, schema, version, value) {
|
|
514
|
+
const changeResult = this.attributeChangeHandler(path, schema, version, value);
|
|
515
|
+
if (MaybePromise.is(changeResult)) {
|
|
516
|
+
const resolver = Promise.resolve(changeResult).catch((error) => logger.error(`Error handling attribute change:`, error)).finally(() => this.attributeUpdatePromises.delete(resolver));
|
|
517
|
+
this.attributeUpdatePromises.add(resolver);
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
attributeChangeHandler(path, schema, version, value) {
|
|
463
521
|
const attributeListenerData = this.attributeListeners.get(attributePathToId(path));
|
|
464
522
|
if (attributeListenerData === void 0) return;
|
|
465
523
|
const { attribute } = attributeListenerData;
|
|
466
524
|
if (attribute instanceof FabricScopedAttributeServer) {
|
|
467
|
-
|
|
525
|
+
return this.readAttribute(path, attribute).then(({ value: value2 }) => {
|
|
526
|
+
this.outstandingAttributeUpdates.set(attributePathToId(path), {
|
|
527
|
+
attribute,
|
|
528
|
+
path,
|
|
529
|
+
schema,
|
|
530
|
+
version,
|
|
531
|
+
value: value2
|
|
532
|
+
});
|
|
533
|
+
this.prepareDataUpdate();
|
|
534
|
+
});
|
|
468
535
|
}
|
|
469
|
-
this.outstandingAttributeUpdates.set(attributePathToId(path), { path, schema, version, value });
|
|
536
|
+
this.outstandingAttributeUpdates.set(attributePathToId(path), { attribute, path, schema, version, value });
|
|
470
537
|
this.prepareDataUpdate();
|
|
471
538
|
}
|
|
472
539
|
eventChangeListener(path, schema, newEvent) {
|
|
473
|
-
this.
|
|
540
|
+
const eventListenerData = this.eventListeners.get(eventPathToId(path));
|
|
541
|
+
if (eventListenerData === void 0) return;
|
|
542
|
+
const { event } = eventListenerData;
|
|
543
|
+
if (event instanceof FabricSensitiveEventServer) {
|
|
544
|
+
const { data } = newEvent;
|
|
545
|
+
if (isObject(data) && "fabricIndex" in data && data.fabricIndex !== this.session.fabric?.fabricIndex) {
|
|
546
|
+
return;
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
this.outstandingEventUpdates.add({ event, path, schema, data: newEvent });
|
|
474
550
|
if (path.isUrgent) {
|
|
475
551
|
this.prepareDataUpdate();
|
|
476
552
|
}
|
|
@@ -486,6 +562,11 @@ class SubscriptionHandler {
|
|
|
486
562
|
}
|
|
487
563
|
async cancel(flush = false, cancelledByPeer = false) {
|
|
488
564
|
this.sendUpdatesActivated = false;
|
|
565
|
+
if (this.attributeUpdatePromises.size) {
|
|
566
|
+
const resolvers = [...this.attributeUpdatePromises.values()];
|
|
567
|
+
this.attributeUpdatePromises.clear();
|
|
568
|
+
await Promise.all(resolvers);
|
|
569
|
+
}
|
|
489
570
|
this.updateTimer.stop();
|
|
490
571
|
this.sendDelayTimer.stop();
|
|
491
572
|
this.unregisterAttributeListeners(Array.from(this.attributeListeners.keys()));
|
|
@@ -515,39 +596,50 @@ class SubscriptionHandler {
|
|
|
515
596
|
await tryCatchAsync(
|
|
516
597
|
async () => {
|
|
517
598
|
if (attributes.length === 0 && events.length === 0) {
|
|
518
|
-
await messenger.sendDataReport(
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
599
|
+
await messenger.sendDataReport(
|
|
600
|
+
{
|
|
601
|
+
suppressResponse: true,
|
|
602
|
+
// suppressResponse ok for empty DataReports
|
|
603
|
+
subscriptionId: this.subscriptionId,
|
|
604
|
+
interactionModelRevision: INTERACTION_MODEL_REVISION
|
|
605
|
+
},
|
|
606
|
+
this.isFabricFiltered
|
|
607
|
+
);
|
|
524
608
|
} else {
|
|
525
|
-
await messenger.sendDataReport(
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
path,
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
609
|
+
await messenger.sendDataReport(
|
|
610
|
+
{
|
|
611
|
+
suppressResponse: false,
|
|
612
|
+
subscriptionId: this.subscriptionId,
|
|
613
|
+
interactionModelRevision: INTERACTION_MODEL_REVISION,
|
|
614
|
+
// TODO Return compressed response once https://github.com/project-chip/connectedhomeip/issues/29359 is solved
|
|
615
|
+
attributeReportsPayload: attributes.map(
|
|
616
|
+
({ path, schema, value, version, attribute }) => ({
|
|
617
|
+
hasFabricSensitiveData: attribute.hasFabricSensitiveData,
|
|
618
|
+
attributeData: {
|
|
619
|
+
path,
|
|
620
|
+
dataVersion: version,
|
|
621
|
+
schema,
|
|
622
|
+
payload: value
|
|
623
|
+
}
|
|
624
|
+
})
|
|
625
|
+
),
|
|
626
|
+
eventReportsPayload: events.map(({ path, schema, event, data }) => {
|
|
627
|
+
const { eventNumber, priority, epochTimestamp, data: payload } = data;
|
|
628
|
+
return {
|
|
629
|
+
hasFabricSensitiveData: event.hasFabricSensitiveData,
|
|
630
|
+
eventData: {
|
|
631
|
+
path,
|
|
632
|
+
eventNumber,
|
|
633
|
+
priority,
|
|
634
|
+
epochTimestamp,
|
|
635
|
+
schema,
|
|
636
|
+
payload
|
|
637
|
+
}
|
|
638
|
+
};
|
|
548
639
|
})
|
|
549
|
-
|
|
550
|
-
|
|
640
|
+
},
|
|
641
|
+
this.isFabricFiltered
|
|
642
|
+
);
|
|
551
643
|
}
|
|
552
644
|
},
|
|
553
645
|
StatusResponseError,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/protocol/interaction/SubscriptionHandler.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * @license\n * Copyright 2022-2024 Matter.js Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { MatterDevice } from \"../../MatterDevice.js\";\nimport { AnyAttributeServer, FabricScopedAttributeServer } from \"../../cluster/server/AttributeServer.js\";\nimport { EventServer } from \"../../cluster/server/EventServer.js\";\nimport { InternalError } from \"../../common/MatterError.js\";\nimport { tryCatch, tryCatchAsync } from \"../../common/TryCatchHandler.js\";\nimport { EventNumber } from \"../../datatype/EventNumber.js\";\nimport { NodeId } from \"../../datatype/NodeId.js\";\nimport { Fabric } from \"../../fabric/Fabric.js\";\nimport { Logger } from \"../../log/Logger.js\";\nimport { NetworkError } from \"../../net/Network.js\";\nimport { SecureSession } from \"../../session/SecureSession.js\";\nimport { Time, Timer } from \"../../time/Time.js\";\nimport { TlvSchema, TypeFromSchema } from \"../../tlv/TlvSchema.js\";\nimport { RetransmissionLimitReachedError } from \"../MessageExchange.js\";\nimport { AttributeReportPayload, EventReportPayload } from \"./AttributeDataEncoder.js\";\nimport { EventHandler, EventStorageData } from \"./EventHandler.js\";\nimport { InteractionEndpointStructure } from \"./InteractionEndpointStructure.js\";\nimport { InteractionServerMessenger } from \"./InteractionMessenger.js\";\nimport {\n TlvAttributePath,\n TlvAttributeStatus,\n TlvDataVersionFilter,\n TlvEventFilter,\n TlvEventPath,\n TlvEventStatus,\n} from \"./InteractionProtocol.js\";\nimport {\n AttributePath,\n AttributeWithPath,\n EventPath,\n EventWithPath,\n INTERACTION_MODEL_REVISION,\n INTERACTION_PROTOCOL_ID,\n attributePathToId,\n clusterPathToId,\n eventPathToId,\n} from \"./InteractionServer.js\";\nimport { StatusCode, StatusResponseError } from \"./StatusCode.js\";\nimport { SubscriptionOptions } from \"./SubscriptionOptions.js\";\n\nconst logger = Logger.get(\"SubscriptionHandler\");\n\ninterface AttributePathWithValueVersion<T> {\n path: TypeFromSchema<typeof TlvAttributePath>;\n schema: TlvSchema<T>;\n value: T;\n version: number;\n}\n\ninterface EventPathWithEventData<T> {\n path: TypeFromSchema<typeof TlvEventPath>;\n schema: TlvSchema<T>;\n event: EventStorageData<T>;\n}\n\nexport class SubscriptionHandler {\n private lastUpdateTimeMs = 0;\n private updateTimer: Timer;\n private readonly sendDelayTimer: Timer;\n private readonly outstandingAttributeUpdates = new Map<string, AttributePathWithValueVersion<any>>();\n private readonly outstandingEventUpdates = new Set<EventPathWithEventData<any>>();\n private readonly attributeListeners = new Map<\n string,\n {\n attribute: AnyAttributeServer<any>;\n listener?: (value: any, version: number) => void;\n }\n >();\n private readonly eventListeners = new Map<\n string,\n {\n event: EventServer<any, any>;\n listener?: (newEvent: EventStorageData<any>) => void;\n }\n >();\n private sendUpdatesActivated = false;\n readonly maxInterval: number;\n readonly sendInterval: number;\n private readonly minIntervalFloorMs: number;\n private readonly maxIntervalCeilingMs: number;\n private readonly server: MatterDevice;\n private readonly fabric: Fabric;\n private readonly peerNodeId: NodeId;\n\n private sendingUpdateInProgress = false;\n private sendNextUpdateImmediately = false;\n private sendUpdateErrorCounter = 0;\n\n constructor(\n readonly subscriptionId: number,\n private readonly session: SecureSession<any>,\n private readonly endpointStructure: InteractionEndpointStructure,\n private readonly attributeRequests: TypeFromSchema<typeof TlvAttributePath>[] | undefined,\n private readonly dataVersionFilters: TypeFromSchema<typeof TlvDataVersionFilter>[] | undefined,\n private readonly eventRequests: TypeFromSchema<typeof TlvEventPath>[] | undefined,\n private readonly eventFilters: TypeFromSchema<typeof TlvEventFilter>[] | undefined,\n private readonly eventHandler: EventHandler,\n private readonly isFabricFiltered: boolean,\n minIntervalFloor: number,\n maxIntervalCeiling: number,\n private readonly cancelCallback: () => void,\n subscriptionOptions: SubscriptionOptions.Configuration,\n ) {\n this.server = this.session.context;\n this.fabric = this.session.associatedFabric;\n this.peerNodeId = this.session.peerNodeId;\n this.minIntervalFloorMs = minIntervalFloor * 1000;\n this.maxIntervalCeilingMs = maxIntervalCeiling * 1000;\n\n const { maxInterval, sendInterval } = this.determineSendingIntervals(\n subscriptionOptions.minIntervalSeconds * 1000,\n subscriptionOptions.maxIntervalSeconds * 1000,\n subscriptionOptions.randomizationWindowSeconds * 1000,\n );\n this.maxInterval = maxInterval;\n this.sendInterval = sendInterval;\n\n this.updateTimer = Time.getTimer(\"Subscription update\", this.sendInterval, () => this.prepareDataUpdate()); // will be started later\n this.sendDelayTimer = Time.getTimer(\"Subscription delay\", 50, () => this.sendUpdate()); // will be started later\n }\n\n private determineSendingIntervals(\n subscriptionMinIntervalMs: number,\n subscriptionMaxIntervalMs: number,\n subscriptionRandomizationWindowMs: number,\n ): { maxInterval: number; sendInterval: number } {\n // Max Interval is the Max interval that the controller request, unless the configured one from the developer\n // is lower. In that case we use the configured one. But we make sure to not be smaller than the requested\n // controller minimum. But in general never faster than minimum interval configured or 2 seconds\n // (SUBSCRIPTION_MIN_INTERVAL_S). Additionally, we add a randomization window to the max interval to avoid all\n // devices sending at the same time.\n const maxInterval =\n Math.max(\n subscriptionMinIntervalMs,\n Math.max(this.minIntervalFloorMs, Math.min(subscriptionMaxIntervalMs, this.maxIntervalCeilingMs)),\n ) + Math.floor(subscriptionRandomizationWindowMs * Math.random());\n let sendInterval = Math.floor(maxInterval / 2); // Ideally we send at half the max interval\n if (sendInterval < 60_000) {\n // But if we have no chance of at least one full resubmission process we do like chip-tool.\n // One full resubmission process takes 33-45 seconds. So 60s means we reach at least first 2 retries of a\n // second subscription report after first failed.\n sendInterval = Math.max(this.minIntervalFloorMs, Math.floor(maxInterval * 0.8));\n }\n if (sendInterval < subscriptionMinIntervalMs) {\n // But not faster than once every 2s\n logger.warn(\n `Determined subscription send interval of ${sendInterval}ms is too low. Using maxInterval (${maxInterval}ms) instead.`,\n );\n sendInterval = subscriptionMinIntervalMs;\n }\n return { maxInterval, sendInterval };\n }\n\n private registerNewAttributes() {\n const newAttributes = new Array<AttributeWithPath>();\n const attributeErrors = new Array<TypeFromSchema<typeof TlvAttributeStatus>>();\n const formerAttributes = new Set<string>(this.attributeListeners.keys());\n\n if (this.attributeRequests !== undefined) {\n this.attributeRequests.forEach(path => {\n const attributes = this.endpointStructure.getAttributes([path]);\n\n if (attributes.length === 0) {\n // TODO: Also check nodeId\n const { endpointId, clusterId, attributeId } = path;\n if (endpointId === undefined || clusterId === undefined || attributeId === undefined) {\n // Wildcard path: Just leave out values\n logger.debug(\n `Subscription attribute ${this.endpointStructure.resolveAttributeName(\n path,\n )}: ignore non-existing attribute`,\n );\n } else {\n // was a concrete path\n attributeErrors.push(\n tryCatch(\n () => {\n if (\n this.endpointStructure.validateConcreteAttributePath(\n endpointId,\n clusterId,\n attributeId,\n )\n ) {\n throw new StatusResponseError(\n `Attribute ${attributeId} is not writable.`,\n StatusCode.UnsupportedWrite,\n );\n }\n throw new InternalError(\n \"validateConcreteAttributePath check should throw StatusResponseError but did not.\",\n );\n },\n StatusResponseError,\n error => {\n logger.debug(\n `Subscription attribute ${this.endpointStructure.resolveAttributeName(\n path,\n )}: unsupported path: Status=${error.code}`,\n );\n return { path, status: { status: error.code } };\n },\n ),\n );\n }\n return;\n }\n\n attributes.forEach(({ path, attribute }) => {\n formerAttributes.delete(attributePathToId(path));\n\n const existingAttributeListener = this.attributeListeners.get(attributePathToId(path));\n if (existingAttributeListener !== undefined) {\n const { attribute: existingAttribute, listener: existingListener } = existingAttributeListener;\n if (existingAttribute !== attribute) {\n if (existingListener !== undefined) {\n existingAttribute.removeValueChangeListener(existingListener);\n }\n this.attributeListeners.delete(attributePathToId(path));\n } else {\n return; // Attribute is already registered and unchanged\n }\n }\n if (attribute.isSubscribable) {\n // If subscribable register listener\n const listener = (value: any, version: number) =>\n this.attributeChangeListener(path, attribute.schema, version, value);\n attribute.addValueChangeListener(listener);\n this.attributeListeners.set(attributePathToId(path), { attribute, listener });\n } else {\n this.attributeListeners.set(attributePathToId(path), { attribute });\n }\n newAttributes.push({ path, attribute });\n });\n });\n }\n\n // Remove all listeners to attributes that no longer match the subscription\n this.unregisterAttributeListeners(Array.from(formerAttributes.values()));\n return { newAttributes, attributeErrors };\n }\n\n unregisterAttributeListeners(list: Array<string>) {\n for (const pathId of list) {\n const existingAttributeListener = this.attributeListeners.get(pathId);\n if (existingAttributeListener !== undefined) {\n const { attribute, listener } = existingAttributeListener;\n if (listener !== undefined) {\n attribute.removeValueChangeListener(listener);\n }\n this.attributeListeners.delete(pathId);\n }\n }\n }\n\n private registerNewEvents() {\n const newEvents = new Array<EventWithPath>();\n const eventErrors = new Array<TypeFromSchema<typeof TlvEventStatus>>();\n const formerEvents = new Set<string>(this.eventListeners.keys());\n\n if (this.eventRequests !== undefined) {\n this.eventRequests.forEach(path => {\n const events = this.endpointStructure.getEvents([path]);\n if (events.length === 0) {\n const { endpointId, clusterId, eventId } = path;\n if (endpointId === undefined || clusterId === undefined || eventId === undefined) {\n // Wildcard path: Just leave out values\n logger.debug(\n `Subscription event ${this.endpointStructure.resolveEventName(\n path,\n )}: ignore non-existing event`,\n );\n } else {\n eventErrors.push(\n tryCatch(\n () => {\n this.endpointStructure.validateConcreteEventPath(endpointId, clusterId, eventId);\n throw new InternalError(\n \"validateConcreteEventPath should throw StatusResponseError but did not.\",\n );\n },\n StatusResponseError,\n error => {\n logger.debug(\n `Subscription event ${this.endpointStructure.resolveEventName(\n path,\n )}: unsupported path: Status=${error.code}`,\n );\n return { path, status: { status: error.code } };\n },\n ),\n );\n }\n return;\n }\n\n events.forEach(({ path, event }) => {\n formerEvents.delete(eventPathToId(path));\n\n const existingEventListener = this.eventListeners.get(eventPathToId(path));\n if (existingEventListener !== undefined) {\n const { event: existingEvent, listener: existingListener } = existingEventListener;\n if (existingEvent !== event) {\n if (existingListener !== undefined) {\n existingEvent.removeListener(existingListener);\n }\n this.eventListeners.delete(eventPathToId(path));\n } else {\n return; // Event is already registered and unchanged\n }\n }\n const listener = (newEvent: EventStorageData<any>) =>\n this.eventChangeListener(path, event.schema, newEvent);\n event.addListener(listener);\n newEvents.push({ path, event });\n this.eventListeners.set(eventPathToId(path), { event, listener });\n });\n });\n }\n\n // Remove all listeners to events that no longer match the subscription\n this.unregisterEventListeners(Array.from(formerEvents.values()));\n\n return { newEvents, eventErrors };\n }\n\n unregisterEventListeners(list: Array<string>) {\n for (const pathId of list) {\n const existingEventListener = this.eventListeners.get(pathId);\n if (existingEventListener !== undefined) {\n const { event, listener } = existingEventListener;\n if (listener !== undefined) {\n event.removeListener(listener);\n }\n this.eventListeners.delete(pathId);\n }\n }\n }\n\n /**\n * Update the session after an endpoint structure change. The method will initialize all missing new attributes and\n * events and will remove listeners no longer needed.\n * Newly added attributes are then treated ad \"changed values\" and will be sent as subscription data update to the\n * controller. The data of newly added events are not sent automatically.\n */\n updateSubscription() {\n const { newAttributes } = this.registerNewAttributes();\n\n for (const { path, attribute } of newAttributes) {\n const { version, value } = attribute.getWithVersion(this.session, true);\n\n // We do not do any version filtering for attributes that are newly added to make sure controller gets\n // most current state\n\n this.outstandingAttributeUpdates.set(attributePathToId(path), {\n path,\n schema: attribute.schema,\n version,\n value,\n });\n }\n\n const { newEvents } = this.registerNewEvents();\n newEvents\n .flatMap(({ path, event: { schema } }): EventPathWithEventData<any>[] => {\n // But we use eventFilters because we do not want to send all events to the controller\n const matchingEvents = this.eventHandler.getEvents(path, this.eventFilters) ?? [];\n return matchingEvents.map(event => ({\n schema,\n path,\n event,\n }));\n })\n .sort((a, b) => {\n const eventNumberA = a.event?.eventNumber ?? EventNumber(0);\n const eventNumberB = b.event?.eventNumber ?? EventNumber(0);\n if (eventNumberA > eventNumberB) {\n return 1;\n } else if (eventNumberA < eventNumberB) {\n return -1;\n } else {\n return 0;\n }\n })\n .forEach(event => this.outstandingEventUpdates.add(event));\n\n this.prepareDataUpdate();\n }\n\n getMaxInterval(): number {\n return Math.ceil(this.maxInterval / 1000);\n }\n\n getSendInterval(): number {\n return Math.ceil(this.sendInterval / 1000);\n }\n\n activateSendingUpdates() {\n // We do not need these data anymore, so we can free some memory\n if (this.eventFilters !== undefined) this.eventFilters.length = 0;\n if (this.dataVersionFilters !== undefined) this.dataVersionFilters.length = 0;\n\n this.sendUpdatesActivated = true;\n if (this.outstandingAttributeUpdates.size > 0 || this.outstandingEventUpdates.size > 0) {\n void this.sendUpdate();\n }\n this.updateTimer = Time.getTimer(\"Subscription update\", this.sendInterval, () =>\n this.prepareDataUpdate(),\n ).start();\n }\n\n /**\n * Check if data should be sent straight away or delayed because the minimum interval is not reached. Delay real\n * sending by 50ms in any case to mke sure to catch all updates.\n */\n prepareDataUpdate() {\n if (this.sendDelayTimer.isRunning) {\n // sending data is already scheduled, data updates go in there\n return;\n }\n\n if (!this.sendUpdatesActivated) {\n return;\n }\n\n this.updateTimer.stop();\n const now = Time.nowMs();\n const timeSinceLastUpdateMs = now - this.lastUpdateTimeMs;\n if (timeSinceLastUpdateMs < this.minIntervalFloorMs) {\n // Respect minimum delay time between updates\n this.updateTimer = Time.getTimer(\n \"Subscription update\",\n this.minIntervalFloorMs - timeSinceLastUpdateMs,\n () => this.prepareDataUpdate(),\n ).start();\n return;\n }\n\n this.sendDelayTimer.start();\n this.updateTimer = Time.getTimer(\"Subscription update\", this.sendInterval, () =>\n this.prepareDataUpdate(),\n ).start();\n }\n\n /**\n * Determine all attributes that have changed since the last update and send them tout to the subscriber.\n */\n async sendUpdate() {\n if (this.sendingUpdateInProgress) {\n logger.debug(\"Sending update already in progress, delaying update ...\");\n this.sendNextUpdateImmediately = true;\n return;\n }\n const attributeUpdatesToSend = Array.from(this.outstandingAttributeUpdates.values());\n this.outstandingAttributeUpdates.clear();\n const eventUpdatesToSend = Array.from(this.outstandingEventUpdates.values());\n this.outstandingEventUpdates.clear();\n this.lastUpdateTimeMs = Time.nowMs();\n\n this.sendingUpdateInProgress = true;\n try {\n await this.sendUpdateMessage(attributeUpdatesToSend, eventUpdatesToSend);\n this.sendUpdateErrorCounter = 0;\n } catch (error) {\n if (this.server.isClosing) {\n // No need to care about resubmissions when the server is closing\n return;\n }\n\n this.sendUpdateErrorCounter++;\n logger.error(\n `Error sending subscription update message (error count=${this.sendUpdateErrorCounter}):`,\n error,\n );\n if (this.sendUpdateErrorCounter > 2) {\n logger.error(\n `Sending update failed 3 times in a row, canceling subscription ${this.subscriptionId} and let controller subscribe again.`,\n );\n this.sendNextUpdateImmediately = false;\n if (error instanceof RetransmissionLimitReachedError || error instanceof NetworkError) {\n // We could not send at all, consider session as dead\n await this.session.destroy(false);\n } else {\n throw error;\n }\n }\n }\n this.sendingUpdateInProgress = false;\n\n if (this.sendNextUpdateImmediately) {\n logger.debug(\"Sending delayed update immediately after last one was sent.\");\n this.sendNextUpdateImmediately = false;\n await this.sendUpdate();\n }\n }\n\n async sendInitialReport(\n messenger: InteractionServerMessenger,\n readAttribute: (path: AttributePath, attribute: AnyAttributeServer<any>) => Promise<any>,\n readEvent: (\n path: EventPath,\n event: EventServer<any, any>,\n eventFilters: TypeFromSchema<typeof TlvEventFilter>[] | undefined,\n ) => Promise<EventStorageData<any>[]>,\n ) {\n this.updateTimer.stop();\n\n const { newAttributes, attributeErrors } = this.registerNewAttributes();\n\n const dataVersionFilterMap = new Map<string, number>(\n this.dataVersionFilters?.map(({ path, dataVersion }) => [clusterPathToId(path), dataVersion]) ?? [],\n );\n\n let attributesFilteredWithVersion = false;\n const attributes = new Array<{\n path: TypeFromSchema<typeof TlvAttributePath>;\n value: any;\n version: number;\n schema: TlvSchema<any>;\n }>();\n for (const { path, attribute } of newAttributes) {\n try {\n const { value, version } = await readAttribute(path, attribute);\n if (value === undefined) continue;\n\n const { nodeId, endpointId, clusterId } = path;\n\n const versionFilterValue =\n endpointId !== undefined && clusterId !== undefined\n ? dataVersionFilterMap.get(clusterPathToId({ nodeId, endpointId, clusterId }))\n : undefined;\n if (versionFilterValue !== undefined && versionFilterValue === version) {\n attributesFilteredWithVersion = true;\n continue;\n }\n\n attributes.push({ path, value, version, schema: attribute.schema });\n } catch (error) {\n logger.error(`Error reading attribute ${this.endpointStructure.resolveAttributeName(path)}:`, error);\n }\n }\n const attributeReportsPayload: AttributeReportPayload[] = attributes.map(\n ({ path, schema, value, version }) => ({\n attributeData: {\n path,\n dataVersion: version,\n payload: value,\n schema,\n },\n }),\n );\n attributeErrors.forEach(attributeStatus => attributeReportsPayload.push({ attributeStatus }));\n\n const { newEvents, eventErrors } = this.registerNewEvents();\n\n let eventsFiltered = false;\n const eventReportsPayload = new Array<EventReportPayload>();\n for (const { path, event } of newEvents) {\n const { schema } = event;\n try {\n const matchingEvents = await readEvent(path, event, this.eventFilters);\n if (matchingEvents.length === 0) {\n eventsFiltered = true;\n } else {\n matchingEvents.forEach(({ eventNumber, priority, epochTimestamp, data }) => {\n eventReportsPayload.push({\n eventData: {\n path,\n eventNumber,\n priority,\n epochTimestamp,\n payload: data,\n schema,\n },\n });\n });\n }\n } catch (error) {\n logger.error(`Error reading event ${this.endpointStructure.resolveEventName(path)}:`, error);\n }\n }\n eventReportsPayload.sort((a, b) => {\n const eventNumberA = a.eventData?.eventNumber ?? 0;\n const eventNumberB = b.eventData?.eventNumber ?? 0;\n if (eventNumberA > eventNumberB) {\n return 1;\n } else if (eventNumberA < eventNumberB) {\n return -1;\n } else {\n return 0;\n }\n });\n\n if (\n attributes.length === 0 &&\n !attributesFilteredWithVersion &&\n eventReportsPayload.length === 0 &&\n !eventsFiltered\n ) {\n throw new StatusResponseError(\n \"Subscription failed because no attributes or events are matching the query\",\n StatusCode.InvalidAction,\n );\n }\n\n eventErrors.forEach(eventStatus => eventReportsPayload.push({ eventStatus }));\n\n logger.debug(\n `Initialize Subscription with ${attributes.length} attributes and ${eventReportsPayload.length} events.`,\n );\n this.lastUpdateTimeMs = Time.nowMs();\n\n await messenger.sendDataReport({\n suppressResponse: false,\n subscriptionId: this.subscriptionId,\n interactionModelRevision: INTERACTION_MODEL_REVISION,\n attributeReportsPayload, // TODO Return compressed response once https://github.com/project-chip/connectedhomeip/issues/29359 is solved\n eventReportsPayload,\n });\n }\n\n attributeChangeListener<T>(\n path: TypeFromSchema<typeof TlvAttributePath>,\n schema: TlvSchema<T>,\n version: number,\n value: T,\n ) {\n const attributeListenerData = this.attributeListeners.get(attributePathToId(path));\n if (attributeListenerData === undefined) return; // Ignore changes to attributes that are not subscribed to\n\n const { attribute } = attributeListenerData;\n if (attribute instanceof FabricScopedAttributeServer) {\n // We can not be sure what value we got for fabric filtered attributes (and from which fabric),\n // so get it again for this relevant fabric\n // TODO: Maybe add try/catch when we add ACL handling and ignore the update if we can not get the value?\n value = attribute.get(this.session, this.isFabricFiltered);\n }\n this.outstandingAttributeUpdates.set(attributePathToId(path), { path, schema, version, value });\n this.prepareDataUpdate();\n }\n\n eventChangeListener<T>(\n path: TypeFromSchema<typeof TlvEventPath>,\n schema: TlvSchema<T>,\n newEvent: EventStorageData<T>,\n ) {\n this.outstandingEventUpdates.add({ path, schema, event: newEvent });\n if (path.isUrgent) {\n this.prepareDataUpdate();\n }\n }\n\n async flush() {\n this.sendDelayTimer.stop();\n logger.debug(\n `Flushing subscription ${this.subscriptionId} with ${this.outstandingAttributeUpdates.size} attributes and ${this.outstandingEventUpdates.size} events`,\n );\n if (this.outstandingAttributeUpdates.size > 0 || this.outstandingEventUpdates.size > 0) {\n void this.sendUpdate();\n }\n }\n\n async cancel(flush = false, cancelledByPeer = false) {\n this.sendUpdatesActivated = false;\n this.updateTimer.stop();\n this.sendDelayTimer.stop();\n this.unregisterAttributeListeners(Array.from(this.attributeListeners.keys()));\n this.unregisterEventListeners(Array.from(this.eventListeners.keys()));\n if (flush) {\n await this.flush();\n }\n this.session.removeSubscription(this.subscriptionId);\n this.cancelCallback();\n if (cancelledByPeer) {\n await this.session.context.startAnnouncement();\n }\n }\n\n private async sendUpdateMessage(\n attributes: AttributePathWithValueVersion<any>[],\n events: EventPathWithEventData<any>[],\n ) {\n logger.debug(\n `Sending subscription update message for ID ${this.subscriptionId} with ${attributes.length} attributes and ${events.length} events`,\n );\n const exchange = this.server.initiateExchange(this.fabric, this.peerNodeId, INTERACTION_PROTOCOL_ID);\n if (exchange === undefined) return;\n logger.debug(\n `Sending subscription changes for ID ${this.subscriptionId}: ${attributes\n .map(\n ({ path, value, version }) =>\n `${this.endpointStructure.resolveAttributeName(path)}=${Logger.toJSON(value)} (${version})`,\n )\n .join(\", \")}`,\n ); // TODO Format path better using endpoint structure\n const messenger = new InteractionServerMessenger(exchange);\n\n try {\n await tryCatchAsync(\n async () => {\n if (attributes.length === 0 && events.length === 0) {\n await messenger.sendDataReport({\n suppressResponse: true, // suppressResponse ok for empty DataReports\n subscriptionId: this.subscriptionId,\n interactionModelRevision: INTERACTION_MODEL_REVISION,\n });\n } else {\n await messenger.sendDataReport({\n suppressResponse: false,\n subscriptionId: this.subscriptionId,\n interactionModelRevision: INTERACTION_MODEL_REVISION,\n // TODO Return compressed response once https://github.com/project-chip/connectedhomeip/issues/29359 is solved\n attributeReportsPayload: attributes.map(({ path, schema, value, version }) => ({\n attributeData: {\n path,\n dataVersion: version,\n schema,\n payload: value,\n },\n })),\n eventReportsPayload: events.map(\n ({ path, schema, event: { eventNumber, priority, epochTimestamp, data } }) => ({\n eventData: {\n path,\n eventNumber,\n priority,\n epochTimestamp,\n schema,\n payload: data,\n },\n }),\n ),\n });\n }\n },\n StatusResponseError,\n async error => {\n if (error.code === StatusCode.InvalidSubscription || error.code === StatusCode.Failure) {\n logger.info(`Subscription ${this.subscriptionId} cancelled by peer.`);\n await this.cancel(false, true);\n } else {\n await this.cancel(false);\n throw error;\n }\n },\n );\n } finally {\n await messenger.close();\n }\n }\n}\n"],
|
|
5
|
-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AAAA;AAAA,cAClB,gBAAgB,KAAK;AAAA,cACrB,0BAA0B;AAAA,YAC9B,CAAC;AAAA,UACL,OAAO;AACH,kBAAM,UAAU,eAAe;AAAA,cAC3B,kBAAkB;AAAA,cAClB,gBAAgB,KAAK;AAAA,cACrB,0BAA0B;AAAA;AAAA,cAE1B,yBAAyB,WAAW,IAAI,CAAC,EAAE,MAAM,QAAQ,OAAO,QAAQ,OAAO;AAAA,gBAC3E,eAAe;AAAA,kBACX;AAAA,kBACA,aAAa;AAAA,kBACb;AAAA,kBACA,SAAS;AAAA,gBACb;AAAA,cACJ,EAAE;AAAA,cACF,qBAAqB,OAAO;AAAA,gBACxB,CAAC,EAAE,MAAM,QAAQ,OAAO,EAAE,aAAa,UAAU,gBAAgB,KAAK,EAAE,OAAO;AAAA,kBAC3E,WAAW;AAAA,oBACP;AAAA,oBACA;AAAA,oBACA;AAAA,oBACA;AAAA,oBACA;AAAA,oBACA,SAAS;AAAA,kBACb;AAAA,gBACJ;AAAA,cACJ;AAAA,YACJ,CAAC;AAAA,UACL;AAAA,QACJ;AAAA,QACA;AAAA,QACA,OAAM,UAAS;AACX,cAAI,MAAM,SAAS,WAAW,uBAAuB,MAAM,SAAS,WAAW,SAAS;AACpF,mBAAO,KAAK,gBAAgB,KAAK,cAAc,qBAAqB;AACpE,kBAAM,KAAK,OAAO,OAAO,IAAI;AAAA,UACjC,OAAO;AACH,kBAAM,KAAK,OAAO,KAAK;AACvB,kBAAM;AAAA,UACV;AAAA,QACJ;AAAA,MACJ;AAAA,IACJ,UAAE;AACE,YAAM,UAAU,MAAM;AAAA,IAC1B;AAAA,EACJ;AACJ;",
|
|
6
|
-
"names": ["path"]
|
|
4
|
+
"sourcesContent": ["/**\n * @license\n * Copyright 2022-2024 Matter.js Authors\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { MatterDevice } from \"../../MatterDevice.js\";\nimport { AnyAttributeServer, FabricScopedAttributeServer } from \"../../cluster/server/AttributeServer.js\";\nimport { AnyEventServer, FabricSensitiveEventServer } from \"../../cluster/server/EventServer.js\";\nimport { InternalError } from \"../../common/MatterError.js\";\nimport { tryCatch, tryCatchAsync } from \"../../common/TryCatchHandler.js\";\nimport { EventNumber } from \"../../datatype/EventNumber.js\";\nimport { NodeId } from \"../../datatype/NodeId.js\";\nimport { Fabric } from \"../../fabric/Fabric.js\";\nimport { Logger } from \"../../log/Logger.js\";\nimport { NetworkError } from \"../../net/Network.js\";\nimport { SecureSession } from \"../../session/SecureSession.js\";\nimport { Time, Timer } from \"../../time/Time.js\";\nimport { TlvSchema, TypeFromSchema } from \"../../tlv/TlvSchema.js\";\nimport { MaybePromise } from \"../../util/Promises.js\";\nimport { isObject } from \"../../util/Type.js\";\nimport { RetransmissionLimitReachedError } from \"../MessageExchange.js\";\nimport { AttributeReportPayload, EventReportPayload } from \"./AttributeDataEncoder.js\";\nimport { EventStorageData } from \"./EventHandler.js\";\nimport { InteractionEndpointStructure } from \"./InteractionEndpointStructure.js\";\nimport { InteractionServerMessenger } from \"./InteractionMessenger.js\";\nimport {\n TlvAttributePath,\n TlvAttributeStatus,\n TlvDataVersionFilter,\n TlvEventFilter,\n TlvEventPath,\n TlvEventStatus,\n} from \"./InteractionProtocol.js\";\nimport {\n AttributePath,\n AttributeWithPath,\n EventPath,\n EventWithPath,\n INTERACTION_MODEL_REVISION,\n INTERACTION_PROTOCOL_ID,\n attributePathToId,\n clusterPathToId,\n eventPathToId,\n} from \"./InteractionServer.js\";\nimport { StatusCode, StatusResponseError } from \"./StatusCode.js\";\nimport { SubscriptionOptions } from \"./SubscriptionOptions.js\";\n\nconst logger = Logger.get(\"SubscriptionHandler\");\n\ninterface AttributePathWithValueVersion<T> {\n path: TypeFromSchema<typeof TlvAttributePath>;\n attribute: AnyAttributeServer<T>;\n schema: TlvSchema<T>;\n value: T;\n version: number;\n}\n\ninterface EventPathWithEventData<T> {\n path: TypeFromSchema<typeof TlvEventPath>;\n event: AnyEventServer<any, any>;\n schema: TlvSchema<T>;\n data: EventStorageData<T>;\n}\n\nexport class SubscriptionHandler {\n readonly subscriptionId: number;\n private readonly session: SecureSession<any>;\n private readonly endpointStructure: InteractionEndpointStructure;\n private readonly attributeRequests?: TypeFromSchema<typeof TlvAttributePath>[];\n private readonly dataVersionFilters?: TypeFromSchema<typeof TlvDataVersionFilter>[];\n private readonly eventRequests?: TypeFromSchema<typeof TlvEventPath>[];\n private readonly eventFilters?: TypeFromSchema<typeof TlvEventFilter>[];\n private readonly isFabricFiltered: boolean;\n private readonly cancelCallback: () => void;\n private readonly readAttribute: (path: AttributePath, attribute: AnyAttributeServer<any>) => Promise<any>;\n private readonly readEvent: (\n path: EventPath,\n event: AnyEventServer<any, any>,\n eventFilters: TypeFromSchema<typeof TlvEventFilter>[] | undefined,\n ) => Promise<EventStorageData<any>[]>;\n\n private lastUpdateTimeMs = 0;\n private updateTimer: Timer;\n private readonly sendDelayTimer: Timer;\n private readonly outstandingAttributeUpdates = new Map<string, AttributePathWithValueVersion<any>>();\n private readonly outstandingEventUpdates = new Set<EventPathWithEventData<any>>();\n private readonly attributeListeners = new Map<\n string,\n {\n attribute: AnyAttributeServer<any>;\n listener?: (value: any, version: number) => void;\n }\n >();\n private readonly eventListeners = new Map<\n string,\n {\n event: AnyEventServer<any, any>;\n listener?: (newEvent: EventStorageData<any>) => void;\n }\n >();\n private sendUpdatesActivated = false;\n readonly maxInterval: number;\n readonly sendInterval: number;\n private readonly minIntervalFloorMs: number;\n private readonly maxIntervalCeilingMs: number;\n private readonly server: MatterDevice;\n private readonly fabric: Fabric;\n private readonly peerNodeId: NodeId;\n\n private sendingUpdateInProgress = false;\n private sendNextUpdateImmediately = false;\n private sendUpdateErrorCounter = 0;\n private attributeUpdatePromises = new Set<PromiseLike<void>>();\n\n constructor(options: {\n subscriptionId: number;\n session: SecureSession<any>;\n endpointStructure: InteractionEndpointStructure;\n attributeRequests?: TypeFromSchema<typeof TlvAttributePath>[];\n dataVersionFilters?: TypeFromSchema<typeof TlvDataVersionFilter>[];\n eventRequests?: TypeFromSchema<typeof TlvEventPath>[];\n eventFilters?: TypeFromSchema<typeof TlvEventFilter>[];\n isFabricFiltered: boolean;\n minIntervalFloor: number;\n maxIntervalCeiling: number;\n cancelCallback: () => void;\n subscriptionOptions: SubscriptionOptions.Configuration;\n readAttribute: (path: AttributePath, attribute: AnyAttributeServer<any>) => Promise<any>;\n readEvent: (\n path: EventPath,\n event: AnyEventServer<any, any>,\n eventFilters: TypeFromSchema<typeof TlvEventFilter>[] | undefined,\n ) => Promise<EventStorageData<any>[]>;\n }) {\n const {\n subscriptionId,\n session,\n endpointStructure,\n attributeRequests,\n dataVersionFilters,\n eventRequests,\n eventFilters,\n isFabricFiltered,\n minIntervalFloor,\n maxIntervalCeiling,\n cancelCallback,\n subscriptionOptions,\n } = options;\n this.subscriptionId = subscriptionId;\n this.session = session;\n this.endpointStructure = endpointStructure;\n this.attributeRequests = attributeRequests;\n this.dataVersionFilters = dataVersionFilters;\n this.eventRequests = eventRequests;\n this.eventFilters = eventFilters;\n this.isFabricFiltered = isFabricFiltered;\n this.cancelCallback = cancelCallback;\n this.readAttribute = options.readAttribute;\n this.readEvent = options.readEvent;\n\n this.server = this.session.context;\n this.fabric = this.session.associatedFabric;\n this.peerNodeId = this.session.peerNodeId;\n this.minIntervalFloorMs = minIntervalFloor * 1000;\n this.maxIntervalCeilingMs = maxIntervalCeiling * 1000;\n\n const { maxInterval, sendInterval } = this.determineSendingIntervals(\n subscriptionOptions.minIntervalSeconds * 1000,\n subscriptionOptions.maxIntervalSeconds * 1000,\n subscriptionOptions.randomizationWindowSeconds * 1000,\n );\n this.maxInterval = maxInterval;\n this.sendInterval = sendInterval;\n\n this.updateTimer = Time.getTimer(\"Subscription update\", this.sendInterval, () => this.prepareDataUpdate()); // will be started later\n this.sendDelayTimer = Time.getTimer(\"Subscription delay\", 50, () => this.sendUpdate()); // will be started later\n }\n\n private determineSendingIntervals(\n subscriptionMinIntervalMs: number,\n subscriptionMaxIntervalMs: number,\n subscriptionRandomizationWindowMs: number,\n ): { maxInterval: number; sendInterval: number } {\n // Max Interval is the Max interval that the controller request, unless the configured one from the developer\n // is lower. In that case we use the configured one. But we make sure to not be smaller than the requested\n // controller minimum. But in general never faster than minimum interval configured or 2 seconds\n // (SUBSCRIPTION_MIN_INTERVAL_S). Additionally, we add a randomization window to the max interval to avoid all\n // devices sending at the same time.\n const maxInterval =\n Math.max(\n subscriptionMinIntervalMs,\n Math.max(this.minIntervalFloorMs, Math.min(subscriptionMaxIntervalMs, this.maxIntervalCeilingMs)),\n ) + Math.floor(subscriptionRandomizationWindowMs * Math.random());\n let sendInterval = Math.floor(maxInterval / 2); // Ideally we send at half the max interval\n if (sendInterval < 60_000) {\n // But if we have no chance of at least one full resubmission process we do like chip-tool.\n // One full resubmission process takes 33-45 seconds. So 60s means we reach at least first 2 retries of a\n // second subscription report after first failed.\n sendInterval = Math.max(this.minIntervalFloorMs, Math.floor(maxInterval * 0.8));\n }\n if (sendInterval < subscriptionMinIntervalMs) {\n // But not faster than once every 2s\n logger.warn(\n `Determined subscription send interval of ${sendInterval}ms is too low. Using maxInterval (${maxInterval}ms) instead.`,\n );\n sendInterval = subscriptionMinIntervalMs;\n }\n return { maxInterval, sendInterval };\n }\n\n private registerNewAttributes() {\n const newAttributes = new Array<AttributeWithPath>();\n const attributeErrors = new Array<TypeFromSchema<typeof TlvAttributeStatus>>();\n const formerAttributes = new Set<string>(this.attributeListeners.keys());\n\n if (this.attributeRequests !== undefined) {\n this.attributeRequests.forEach(path => {\n const attributes = this.endpointStructure.getAttributes([path]);\n\n if (attributes.length === 0) {\n // TODO: Also check nodeId\n const { endpointId, clusterId, attributeId } = path;\n if (endpointId === undefined || clusterId === undefined || attributeId === undefined) {\n // Wildcard path: Just leave out values\n logger.debug(\n `Subscription attribute ${this.endpointStructure.resolveAttributeName(\n path,\n )}: ignore non-existing attribute`,\n );\n } else {\n // was a concrete path\n attributeErrors.push(\n tryCatch(\n () => {\n if (\n this.endpointStructure.validateConcreteAttributePath(\n endpointId,\n clusterId,\n attributeId,\n )\n ) {\n throw new StatusResponseError(\n `Attribute ${attributeId} is not writable.`,\n StatusCode.UnsupportedWrite,\n );\n }\n throw new InternalError(\n \"validateConcreteAttributePath check should throw StatusResponseError but did not.\",\n );\n },\n StatusResponseError,\n error => {\n logger.debug(\n `Subscription attribute ${this.endpointStructure.resolveAttributeName(\n path,\n )}: unsupported path: Status=${error.code}`,\n );\n return { path, status: { status: error.code } };\n },\n ),\n );\n }\n return;\n }\n\n attributes.forEach(({ path, attribute }) => {\n formerAttributes.delete(attributePathToId(path));\n\n const existingAttributeListener = this.attributeListeners.get(attributePathToId(path));\n if (existingAttributeListener !== undefined) {\n const { attribute: existingAttribute, listener: existingListener } = existingAttributeListener;\n if (existingAttribute !== attribute) {\n if (existingListener !== undefined) {\n existingAttribute.removeValueChangeListener(existingListener);\n }\n this.attributeListeners.delete(attributePathToId(path));\n } else {\n return; // Attribute is already registered and unchanged\n }\n }\n if (attribute.isSubscribable) {\n // If subscribable register listener\n // TODO: Move to state change listeners from behaviors to remove the dangling promise here\n const listener = (value: any, version: number) =>\n this.attributeChangeListener(path, attribute.schema, version, value);\n attribute.addValueChangeListener(listener);\n this.attributeListeners.set(attributePathToId(path), { attribute, listener });\n } else {\n this.attributeListeners.set(attributePathToId(path), { attribute });\n }\n newAttributes.push({ path, attribute });\n });\n });\n }\n\n // Remove all listeners to attributes that no longer match the subscription\n this.unregisterAttributeListeners(Array.from(formerAttributes.values()));\n return { newAttributes, attributeErrors };\n }\n\n unregisterAttributeListeners(list: Array<string>) {\n for (const pathId of list) {\n const existingAttributeListener = this.attributeListeners.get(pathId);\n if (existingAttributeListener !== undefined) {\n const { attribute, listener } = existingAttributeListener;\n if (listener !== undefined) {\n attribute.removeValueChangeListener(listener);\n }\n this.attributeListeners.delete(pathId);\n }\n }\n }\n\n private registerNewEvents() {\n const newEvents = new Array<EventWithPath>();\n const eventErrors = new Array<TypeFromSchema<typeof TlvEventStatus>>();\n const formerEvents = new Set<string>(this.eventListeners.keys());\n\n if (this.eventRequests !== undefined) {\n this.eventRequests.forEach(path => {\n const events = this.endpointStructure.getEvents([path]);\n if (events.length === 0) {\n const { endpointId, clusterId, eventId } = path;\n if (endpointId === undefined || clusterId === undefined || eventId === undefined) {\n // Wildcard path: Just leave out values\n logger.debug(\n `Subscription event ${this.endpointStructure.resolveEventName(\n path,\n )}: ignore non-existing event`,\n );\n } else {\n eventErrors.push(\n tryCatch(\n () => {\n this.endpointStructure.validateConcreteEventPath(endpointId, clusterId, eventId);\n throw new InternalError(\n \"validateConcreteEventPath should throw StatusResponseError but did not.\",\n );\n },\n StatusResponseError,\n error => {\n logger.debug(\n `Subscription event ${this.endpointStructure.resolveEventName(\n path,\n )}: unsupported path: Status=${error.code}`,\n );\n return { path, status: { status: error.code } };\n },\n ),\n );\n }\n return;\n }\n\n events.forEach(({ path, event }) => {\n formerEvents.delete(eventPathToId(path));\n\n const existingEventListener = this.eventListeners.get(eventPathToId(path));\n if (existingEventListener !== undefined) {\n const { event: existingEvent, listener: existingListener } = existingEventListener;\n if (existingEvent !== event) {\n if (existingListener !== undefined) {\n existingEvent.removeListener(existingListener);\n }\n this.eventListeners.delete(eventPathToId(path));\n } else {\n return; // Event is already registered and unchanged\n }\n }\n const listener = (newEvent: EventStorageData<any>) =>\n this.eventChangeListener(path, event.schema, newEvent);\n event.addListener(listener);\n newEvents.push({ path, event });\n this.eventListeners.set(eventPathToId(path), { event, listener });\n });\n });\n }\n\n // Remove all listeners to events that no longer match the subscription\n this.unregisterEventListeners(Array.from(formerEvents.values()));\n\n return { newEvents, eventErrors };\n }\n\n unregisterEventListeners(list: Array<string>) {\n for (const pathId of list) {\n const existingEventListener = this.eventListeners.get(pathId);\n if (existingEventListener !== undefined) {\n const { event, listener } = existingEventListener;\n if (listener !== undefined) {\n event.removeListener(listener);\n }\n this.eventListeners.delete(pathId);\n }\n }\n }\n\n /**\n * Update the session after an endpoint structure change. The method will initialize all missing new attributes and\n * events and will remove listeners no longer needed.\n * Newly added attributes are then treated ad \"changed values\" and will be sent as subscription data update to the\n * controller. The data of newly added events are not sent automatically.\n */\n async updateSubscription() {\n const { newAttributes } = this.registerNewAttributes();\n\n for (const { path, attribute } of newAttributes) {\n const { version, value } = await this.readAttribute(path, attribute);\n\n // We do not do any version filtering for attributes that are newly added to make sure controller gets\n // most current state\n\n this.outstandingAttributeUpdates.set(attributePathToId(path), {\n attribute,\n path,\n schema: attribute.schema,\n version,\n value,\n });\n }\n\n const { newEvents } = this.registerNewEvents();\n newEvents\n .flatMap(({ path, event }): EventPathWithEventData<any>[] => {\n // But we use eventFilters because we do not want to send all events to the controller\n const { schema } = event;\n const matchingEvents = event.get(this.session, this.isFabricFiltered, undefined, this.eventFilters);\n return matchingEvents.map(data => ({\n event,\n schema,\n path,\n data,\n }));\n })\n .sort((a, b) => {\n const eventNumberA = a.data?.eventNumber ?? EventNumber(0);\n const eventNumberB = b.data?.eventNumber ?? EventNumber(0);\n if (eventNumberA > eventNumberB) {\n return 1;\n } else if (eventNumberA < eventNumberB) {\n return -1;\n } else {\n return 0;\n }\n })\n .forEach(event => this.outstandingEventUpdates.add(event));\n\n this.prepareDataUpdate();\n }\n\n getMaxInterval(): number {\n return Math.ceil(this.maxInterval / 1000);\n }\n\n getSendInterval(): number {\n return Math.ceil(this.sendInterval / 1000);\n }\n\n activateSendingUpdates() {\n // We do not need these data anymore, so we can free some memory\n if (this.eventFilters !== undefined) this.eventFilters.length = 0;\n if (this.dataVersionFilters !== undefined) this.dataVersionFilters.length = 0;\n\n this.sendUpdatesActivated = true;\n if (this.outstandingAttributeUpdates.size > 0 || this.outstandingEventUpdates.size > 0) {\n void this.sendUpdate();\n }\n this.updateTimer = Time.getTimer(\"Subscription update\", this.sendInterval, () =>\n this.prepareDataUpdate(),\n ).start();\n }\n\n /**\n * Check if data should be sent straight away or delayed because the minimum interval is not reached. Delay real\n * sending by 50ms in any case to mke sure to catch all updates.\n */\n prepareDataUpdate() {\n if (this.sendDelayTimer.isRunning) {\n // sending data is already scheduled, data updates go in there\n return;\n }\n\n if (!this.sendUpdatesActivated) {\n return;\n }\n\n this.updateTimer.stop();\n const now = Time.nowMs();\n const timeSinceLastUpdateMs = now - this.lastUpdateTimeMs;\n if (timeSinceLastUpdateMs < this.minIntervalFloorMs) {\n // Respect minimum delay time between updates\n this.updateTimer = Time.getTimer(\n \"Subscription update\",\n this.minIntervalFloorMs - timeSinceLastUpdateMs,\n () => this.prepareDataUpdate(),\n ).start();\n return;\n }\n\n this.sendDelayTimer.start();\n this.updateTimer = Time.getTimer(\"Subscription update\", this.sendInterval, () =>\n this.prepareDataUpdate(),\n ).start();\n }\n\n /**\n * Determine all attributes that have changed since the last update and send them tout to the subscriber.\n */\n async sendUpdate() {\n if (this.sendingUpdateInProgress) {\n logger.debug(\"Sending update already in progress, delaying update ...\");\n this.sendNextUpdateImmediately = true;\n return;\n }\n\n // Get all outstanding updates, make sure the order is correct per endpoint and cluster\n const attributeUpdatesToSend = new Array<AttributePathWithValueVersion<any>>();\n const attributeUpdates: Record<string, AttributePathWithValueVersion<any>[]> = {};\n Array.from(this.outstandingAttributeUpdates.values()).forEach(entry => {\n const {\n path: { nodeId, endpointId, clusterId },\n } = entry;\n const pathId = `${nodeId}-${endpointId}-${clusterId}`;\n attributeUpdates[pathId] = attributeUpdates[pathId] ?? [];\n attributeUpdates[pathId].push(entry);\n });\n this.outstandingAttributeUpdates.clear();\n Object.values(attributeUpdates).forEach(data =>\n attributeUpdatesToSend.push(\n ...data.sort(({ version: versionA }, { version: versionB }) => versionA - versionB),\n ),\n );\n\n const eventUpdatesToSend = Array.from(this.outstandingEventUpdates.values());\n this.outstandingEventUpdates.clear();\n this.lastUpdateTimeMs = Time.nowMs();\n\n this.sendingUpdateInProgress = true;\n try {\n await this.sendUpdateMessage(attributeUpdatesToSend, eventUpdatesToSend);\n this.sendUpdateErrorCounter = 0;\n } catch (error) {\n if (this.server.isClosing) {\n // No need to care about resubmissions when the server is closing\n return;\n }\n\n this.sendUpdateErrorCounter++;\n logger.error(\n `Error sending subscription update message (error count=${this.sendUpdateErrorCounter}):`,\n error,\n );\n if (this.sendUpdateErrorCounter > 2) {\n logger.error(\n `Sending update failed 3 times in a row, canceling subscription ${this.subscriptionId} and let controller subscribe again.`,\n );\n this.sendNextUpdateImmediately = false;\n if (error instanceof RetransmissionLimitReachedError || error instanceof NetworkError) {\n // We could not send at all, consider session as dead\n await this.session.destroy(false);\n } else {\n throw error;\n }\n }\n }\n this.sendingUpdateInProgress = false;\n\n if (this.sendNextUpdateImmediately) {\n logger.debug(\"Sending delayed update immediately after last one was sent.\");\n this.sendNextUpdateImmediately = false;\n await this.sendUpdate();\n }\n }\n\n async sendInitialReport(messenger: InteractionServerMessenger) {\n this.updateTimer.stop();\n\n const { newAttributes, attributeErrors } = this.registerNewAttributes();\n\n const dataVersionFilterMap = new Map<string, number>(\n this.dataVersionFilters?.map(({ path, dataVersion }) => [clusterPathToId(path), dataVersion]) ?? [],\n );\n\n let attributesFilteredWithVersion = false;\n const attributes = new Array<{\n path: TypeFromSchema<typeof TlvAttributePath>;\n value: any;\n version: number;\n schema: TlvSchema<any>;\n attribute: AnyAttributeServer<any>;\n }>();\n for (const { path, attribute } of newAttributes) {\n try {\n const { value, version } = await this.readAttribute(path, attribute);\n if (value === undefined) continue;\n\n const { nodeId, endpointId, clusterId } = path;\n\n const versionFilterValue =\n endpointId !== undefined && clusterId !== undefined\n ? dataVersionFilterMap.get(clusterPathToId({ nodeId, endpointId, clusterId }))\n : undefined;\n if (versionFilterValue !== undefined && versionFilterValue === version) {\n attributesFilteredWithVersion = true;\n continue;\n }\n\n attributes.push({ path, value, version, schema: attribute.schema, attribute });\n } catch (error) {\n logger.error(`Error reading attribute ${this.endpointStructure.resolveAttributeName(path)}:`, error);\n }\n }\n const attributeReportsPayload: AttributeReportPayload[] = attributes.map(\n ({ path, schema, value, version, attribute }) => ({\n hasFabricSensitiveData: attribute.hasFabricSensitiveData,\n attributeData: {\n path,\n dataVersion: version,\n payload: value,\n schema,\n },\n }),\n );\n attributeErrors.forEach(attributeStatus =>\n attributeReportsPayload.push({\n hasFabricSensitiveData: false,\n attributeStatus,\n }),\n );\n\n const { newEvents, eventErrors } = this.registerNewEvents();\n\n let eventsFiltered = false;\n const eventReportsPayload = new Array<EventReportPayload>();\n for (const { path, event } of newEvents) {\n const { schema } = event;\n try {\n const matchingEvents = await this.readEvent(path, event, this.eventFilters);\n if (matchingEvents.length === 0) {\n eventsFiltered = true;\n } else {\n matchingEvents.forEach(({ eventNumber, priority, epochTimestamp, data }) => {\n eventReportsPayload.push({\n hasFabricSensitiveData: event.hasFabricSensitiveData,\n eventData: {\n path,\n eventNumber,\n priority,\n epochTimestamp,\n payload: data,\n schema,\n },\n });\n });\n }\n } catch (error) {\n logger.error(`Error reading event ${this.endpointStructure.resolveEventName(path)}:`, error);\n }\n }\n eventReportsPayload.sort((a, b) => {\n const eventNumberA = a.eventData?.eventNumber ?? 0;\n const eventNumberB = b.eventData?.eventNumber ?? 0;\n if (eventNumberA > eventNumberB) {\n return 1;\n } else if (eventNumberA < eventNumberB) {\n return -1;\n } else {\n return 0;\n }\n });\n\n if (\n attributes.length === 0 &&\n !attributesFilteredWithVersion &&\n eventReportsPayload.length === 0 &&\n !eventsFiltered\n ) {\n throw new StatusResponseError(\n \"Subscription failed because no attributes or events are matching the query\",\n StatusCode.InvalidAction,\n );\n }\n\n eventErrors.forEach(eventStatus =>\n eventReportsPayload.push({\n hasFabricSensitiveData: false,\n eventStatus,\n }),\n );\n\n logger.debug(\n `Initialize Subscription with ${attributes.length} attributes and ${eventReportsPayload.length} events.`,\n );\n this.lastUpdateTimeMs = Time.nowMs();\n\n await messenger.sendDataReport(\n {\n suppressResponse: false,\n subscriptionId: this.subscriptionId,\n interactionModelRevision: INTERACTION_MODEL_REVISION,\n attributeReportsPayload, // TODO Return compressed response once https://github.com/project-chip/connectedhomeip/issues/29359 is solved\n eventReportsPayload,\n },\n this.isFabricFiltered,\n );\n }\n\n attributeChangeListener<T>(path: AttributePath, schema: TlvSchema<T>, version: number, value: T) {\n const changeResult = this.attributeChangeHandler(path, schema, version, value);\n if (MaybePromise.is(changeResult)) {\n const resolver = Promise.resolve(changeResult)\n .catch(error => logger.error(`Error handling attribute change:`, error))\n .finally(() => this.attributeUpdatePromises.delete(resolver));\n this.attributeUpdatePromises.add(resolver);\n }\n }\n\n attributeChangeHandler<T>(\n path: AttributePath,\n schema: TlvSchema<T>,\n version: number,\n value: T,\n ): MaybePromise<void> {\n const attributeListenerData = this.attributeListeners.get(attributePathToId(path));\n if (attributeListenerData === undefined) return; // Ignore changes to attributes that are not subscribed to\n\n const { attribute } = attributeListenerData;\n if (attribute instanceof FabricScopedAttributeServer) {\n // We can not be sure what value we got for fabric filtered attributes (and from which fabric),\n // so get it again for this relevant fabric. This also makes sure that fabric sensitive fields are filtered\n // TODO: Maybe add try/catch when we add ACL handling and ignore the update if we can not get the value?\n return this.readAttribute(path, attribute).then(({ value }) => {\n this.outstandingAttributeUpdates.set(attributePathToId(path), {\n attribute,\n path,\n schema,\n version,\n value,\n });\n this.prepareDataUpdate();\n });\n }\n this.outstandingAttributeUpdates.set(attributePathToId(path), { attribute, path, schema, version, value });\n this.prepareDataUpdate();\n }\n\n eventChangeListener<T>(path: EventPath, schema: TlvSchema<T>, newEvent: EventStorageData<T>) {\n const eventListenerData = this.eventListeners.get(eventPathToId(path));\n if (eventListenerData === undefined) return; // Ignore changes to attributes that are not subscribed to\n\n const { event } = eventListenerData;\n if (event instanceof FabricSensitiveEventServer) {\n const { data } = newEvent;\n if (isObject(data) && \"fabricIndex\" in data && data.fabricIndex !== this.session.fabric?.fabricIndex) {\n // Ignore events from different fabrics because events are kind of always fabric filtered\n return;\n }\n }\n this.outstandingEventUpdates.add({ event, path, schema, data: newEvent });\n if (path.isUrgent) {\n this.prepareDataUpdate();\n }\n }\n\n async flush() {\n this.sendDelayTimer.stop();\n logger.debug(\n `Flushing subscription ${this.subscriptionId} with ${this.outstandingAttributeUpdates.size} attributes and ${this.outstandingEventUpdates.size} events`,\n );\n if (this.outstandingAttributeUpdates.size > 0 || this.outstandingEventUpdates.size > 0) {\n void this.sendUpdate();\n }\n }\n\n async cancel(flush = false, cancelledByPeer = false) {\n this.sendUpdatesActivated = false;\n if (this.attributeUpdatePromises.size) {\n const resolvers = [...this.attributeUpdatePromises.values()];\n this.attributeUpdatePromises.clear();\n await Promise.all(resolvers);\n }\n this.updateTimer.stop();\n this.sendDelayTimer.stop();\n this.unregisterAttributeListeners(Array.from(this.attributeListeners.keys()));\n this.unregisterEventListeners(Array.from(this.eventListeners.keys()));\n if (flush) {\n await this.flush();\n }\n this.session.removeSubscription(this.subscriptionId);\n this.cancelCallback();\n if (cancelledByPeer) {\n await this.session.context.startAnnouncement();\n }\n }\n\n private async sendUpdateMessage(\n attributes: AttributePathWithValueVersion<any>[],\n events: EventPathWithEventData<any>[],\n ) {\n logger.debug(\n `Sending subscription update message for ID ${this.subscriptionId} with ${attributes.length} attributes and ${events.length} events`,\n );\n const exchange = this.server.initiateExchange(this.fabric, this.peerNodeId, INTERACTION_PROTOCOL_ID);\n if (exchange === undefined) return;\n logger.debug(\n `Sending subscription changes for ID ${this.subscriptionId}: ${attributes\n .map(\n ({ path, value, version }) =>\n `${this.endpointStructure.resolveAttributeName(path)}=${Logger.toJSON(value)} (${version})`,\n )\n .join(\", \")}`,\n ); // TODO Format path better using endpoint structure\n const messenger = new InteractionServerMessenger(exchange);\n\n try {\n await tryCatchAsync(\n async () => {\n if (attributes.length === 0 && events.length === 0) {\n await messenger.sendDataReport(\n {\n suppressResponse: true, // suppressResponse ok for empty DataReports\n subscriptionId: this.subscriptionId,\n interactionModelRevision: INTERACTION_MODEL_REVISION,\n },\n this.isFabricFiltered,\n );\n } else {\n await messenger.sendDataReport(\n {\n suppressResponse: false,\n subscriptionId: this.subscriptionId,\n interactionModelRevision: INTERACTION_MODEL_REVISION,\n // TODO Return compressed response once https://github.com/project-chip/connectedhomeip/issues/29359 is solved\n attributeReportsPayload: attributes.map(\n ({ path, schema, value, version, attribute }) => ({\n hasFabricSensitiveData: attribute.hasFabricSensitiveData,\n attributeData: {\n path,\n dataVersion: version,\n schema,\n payload: value,\n },\n }),\n ),\n eventReportsPayload: events.map(({ path, schema, event, data }) => {\n const { eventNumber, priority, epochTimestamp, data: payload } = data;\n return {\n hasFabricSensitiveData: event.hasFabricSensitiveData,\n eventData: {\n path,\n eventNumber,\n priority,\n epochTimestamp,\n schema,\n payload,\n },\n };\n }),\n },\n this.isFabricFiltered,\n );\n }\n },\n StatusResponseError,\n async error => {\n if (error.code === StatusCode.InvalidSubscription || error.code === StatusCode.Failure) {\n logger.info(`Subscription ${this.subscriptionId} cancelled by peer.`);\n await this.cancel(false, true);\n } else {\n await this.cancel(false);\n throw error;\n }\n },\n );\n } finally {\n await messenger.close();\n }\n }\n}\n"],
|
|
5
|
+
"mappings": "AAAA;AAAA;AAAA;AAAA;AAAA;AAOA,SAA6B,mCAAmC;AAChE,SAAyB,kCAAkC;AAC3D,SAAS,qBAAqB;AAC9B,SAAS,UAAU,qBAAqB;AACxC,SAAS,mBAAmB;AAG5B,SAAS,cAAc;AACvB,SAAS,oBAAoB;AAE7B,SAAS,YAAmB;AAE5B,SAAS,oBAAoB;AAC7B,SAAS,gBAAgB;AACzB,SAAS,uCAAuC;AAIhD,SAAS,kCAAkC;AAS3C;AAAA,EAKI;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACG;AACP,SAAS,YAAY,2BAA2B;AAGhD,MAAM,SAAS,OAAO,IAAI,qBAAqB;AAiBxC,MAAM,oBAAoB;AAAA,EAkD7B,YAAY,SAmBT;AApDH,SAAQ,mBAAmB;AAG3B,SAAiB,8BAA8B,oBAAI,IAAgD;AACnG,SAAiB,0BAA0B,oBAAI,IAAiC;AAChF,SAAiB,qBAAqB,oBAAI,IAMxC;AACF,SAAiB,iBAAiB,oBAAI,IAMpC;AACF,SAAQ,uB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