@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
|
@@ -22,12 +22,15 @@ __export(SubscriptionHandler_exports, {
|
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(SubscriptionHandler_exports);
|
|
24
24
|
var import_AttributeServer = require("../../cluster/server/AttributeServer.js");
|
|
25
|
+
var import_EventServer = require("../../cluster/server/EventServer.js");
|
|
25
26
|
var import_MatterError = require("../../common/MatterError.js");
|
|
26
27
|
var import_TryCatchHandler = require("../../common/TryCatchHandler.js");
|
|
27
28
|
var import_EventNumber = require("../../datatype/EventNumber.js");
|
|
28
29
|
var import_Logger = require("../../log/Logger.js");
|
|
29
30
|
var import_Network = require("../../net/Network.js");
|
|
30
31
|
var import_Time = require("../../time/Time.js");
|
|
32
|
+
var import_Promises = require("../../util/Promises.js");
|
|
33
|
+
var import_Type = require("../../util/Type.js");
|
|
31
34
|
var import_MessageExchange = require("../MessageExchange.js");
|
|
32
35
|
var import_InteractionMessenger = require("./InteractionMessenger.js");
|
|
33
36
|
var import_InteractionServer = require("./InteractionServer.js");
|
|
@@ -39,17 +42,7 @@ var import_StatusCode = require("./StatusCode.js");
|
|
|
39
42
|
*/
|
|
40
43
|
const logger = import_Logger.Logger.get("SubscriptionHandler");
|
|
41
44
|
class SubscriptionHandler {
|
|
42
|
-
constructor(
|
|
43
|
-
this.subscriptionId = subscriptionId;
|
|
44
|
-
this.session = session;
|
|
45
|
-
this.endpointStructure = endpointStructure;
|
|
46
|
-
this.attributeRequests = attributeRequests;
|
|
47
|
-
this.dataVersionFilters = dataVersionFilters;
|
|
48
|
-
this.eventRequests = eventRequests;
|
|
49
|
-
this.eventFilters = eventFilters;
|
|
50
|
-
this.eventHandler = eventHandler;
|
|
51
|
-
this.isFabricFiltered = isFabricFiltered;
|
|
52
|
-
this.cancelCallback = cancelCallback;
|
|
45
|
+
constructor(options) {
|
|
53
46
|
this.lastUpdateTimeMs = 0;
|
|
54
47
|
this.outstandingAttributeUpdates = /* @__PURE__ */ new Map();
|
|
55
48
|
this.outstandingEventUpdates = /* @__PURE__ */ new Set();
|
|
@@ -59,6 +52,32 @@ class SubscriptionHandler {
|
|
|
59
52
|
this.sendingUpdateInProgress = false;
|
|
60
53
|
this.sendNextUpdateImmediately = false;
|
|
61
54
|
this.sendUpdateErrorCounter = 0;
|
|
55
|
+
this.attributeUpdatePromises = /* @__PURE__ */ new Set();
|
|
56
|
+
const {
|
|
57
|
+
subscriptionId,
|
|
58
|
+
session,
|
|
59
|
+
endpointStructure,
|
|
60
|
+
attributeRequests,
|
|
61
|
+
dataVersionFilters,
|
|
62
|
+
eventRequests,
|
|
63
|
+
eventFilters,
|
|
64
|
+
isFabricFiltered,
|
|
65
|
+
minIntervalFloor,
|
|
66
|
+
maxIntervalCeiling,
|
|
67
|
+
cancelCallback,
|
|
68
|
+
subscriptionOptions
|
|
69
|
+
} = options;
|
|
70
|
+
this.subscriptionId = subscriptionId;
|
|
71
|
+
this.session = session;
|
|
72
|
+
this.endpointStructure = endpointStructure;
|
|
73
|
+
this.attributeRequests = attributeRequests;
|
|
74
|
+
this.dataVersionFilters = dataVersionFilters;
|
|
75
|
+
this.eventRequests = eventRequests;
|
|
76
|
+
this.eventFilters = eventFilters;
|
|
77
|
+
this.isFabricFiltered = isFabricFiltered;
|
|
78
|
+
this.cancelCallback = cancelCallback;
|
|
79
|
+
this.readAttribute = options.readAttribute;
|
|
80
|
+
this.readEvent = options.readEvent;
|
|
62
81
|
this.server = this.session.context;
|
|
63
82
|
this.fabric = this.session.associatedFabric;
|
|
64
83
|
this.peerNodeId = this.session.peerNodeId;
|
|
@@ -258,11 +277,12 @@ class SubscriptionHandler {
|
|
|
258
277
|
* Newly added attributes are then treated ad "changed values" and will be sent as subscription data update to the
|
|
259
278
|
* controller. The data of newly added events are not sent automatically.
|
|
260
279
|
*/
|
|
261
|
-
updateSubscription() {
|
|
280
|
+
async updateSubscription() {
|
|
262
281
|
const { newAttributes } = this.registerNewAttributes();
|
|
263
282
|
for (const { path, attribute } of newAttributes) {
|
|
264
|
-
const { version, value } =
|
|
283
|
+
const { version, value } = await this.readAttribute(path, attribute);
|
|
265
284
|
this.outstandingAttributeUpdates.set((0, import_InteractionServer.attributePathToId)(path), {
|
|
285
|
+
attribute,
|
|
266
286
|
path,
|
|
267
287
|
schema: attribute.schema,
|
|
268
288
|
version,
|
|
@@ -270,16 +290,18 @@ class SubscriptionHandler {
|
|
|
270
290
|
});
|
|
271
291
|
}
|
|
272
292
|
const { newEvents } = this.registerNewEvents();
|
|
273
|
-
newEvents.flatMap(({ path, event
|
|
274
|
-
const
|
|
275
|
-
|
|
293
|
+
newEvents.flatMap(({ path, event }) => {
|
|
294
|
+
const { schema } = event;
|
|
295
|
+
const matchingEvents = event.get(this.session, this.isFabricFiltered, void 0, this.eventFilters);
|
|
296
|
+
return matchingEvents.map((data) => ({
|
|
297
|
+
event,
|
|
276
298
|
schema,
|
|
277
299
|
path,
|
|
278
|
-
|
|
300
|
+
data
|
|
279
301
|
}));
|
|
280
302
|
}).sort((a, b) => {
|
|
281
|
-
const eventNumberA = a.
|
|
282
|
-
const eventNumberB = b.
|
|
303
|
+
const eventNumberA = a.data?.eventNumber ?? (0, import_EventNumber.EventNumber)(0);
|
|
304
|
+
const eventNumberB = b.data?.eventNumber ?? (0, import_EventNumber.EventNumber)(0);
|
|
283
305
|
if (eventNumberA > eventNumberB) {
|
|
284
306
|
return 1;
|
|
285
307
|
} else if (eventNumberA < eventNumberB) {
|
|
@@ -347,8 +369,22 @@ class SubscriptionHandler {
|
|
|
347
369
|
this.sendNextUpdateImmediately = true;
|
|
348
370
|
return;
|
|
349
371
|
}
|
|
350
|
-
const attributeUpdatesToSend = Array
|
|
372
|
+
const attributeUpdatesToSend = new Array();
|
|
373
|
+
const attributeUpdates = {};
|
|
374
|
+
Array.from(this.outstandingAttributeUpdates.values()).forEach((entry) => {
|
|
375
|
+
const {
|
|
376
|
+
path: { nodeId, endpointId, clusterId }
|
|
377
|
+
} = entry;
|
|
378
|
+
const pathId = `${nodeId}-${endpointId}-${clusterId}`;
|
|
379
|
+
attributeUpdates[pathId] = attributeUpdates[pathId] ?? [];
|
|
380
|
+
attributeUpdates[pathId].push(entry);
|
|
381
|
+
});
|
|
351
382
|
this.outstandingAttributeUpdates.clear();
|
|
383
|
+
Object.values(attributeUpdates).forEach(
|
|
384
|
+
(data) => attributeUpdatesToSend.push(
|
|
385
|
+
...data.sort(({ version: versionA }, { version: versionB }) => versionA - versionB)
|
|
386
|
+
)
|
|
387
|
+
);
|
|
352
388
|
const eventUpdatesToSend = Array.from(this.outstandingEventUpdates.values());
|
|
353
389
|
this.outstandingEventUpdates.clear();
|
|
354
390
|
this.lastUpdateTimeMs = import_Time.Time.nowMs();
|
|
@@ -384,7 +420,7 @@ class SubscriptionHandler {
|
|
|
384
420
|
await this.sendUpdate();
|
|
385
421
|
}
|
|
386
422
|
}
|
|
387
|
-
async sendInitialReport(messenger
|
|
423
|
+
async sendInitialReport(messenger) {
|
|
388
424
|
this.updateTimer.stop();
|
|
389
425
|
const { newAttributes, attributeErrors } = this.registerNewAttributes();
|
|
390
426
|
const dataVersionFilterMap = new Map(
|
|
@@ -394,7 +430,7 @@ class SubscriptionHandler {
|
|
|
394
430
|
const attributes = new Array();
|
|
395
431
|
for (const { path, attribute } of newAttributes) {
|
|
396
432
|
try {
|
|
397
|
-
const { value, version } = await readAttribute(path, attribute);
|
|
433
|
+
const { value, version } = await this.readAttribute(path, attribute);
|
|
398
434
|
if (value === void 0) continue;
|
|
399
435
|
const { nodeId, endpointId, clusterId } = path;
|
|
400
436
|
const versionFilterValue = endpointId !== void 0 && clusterId !== void 0 ? dataVersionFilterMap.get((0, import_InteractionServer.clusterPathToId)({ nodeId, endpointId, clusterId })) : void 0;
|
|
@@ -402,13 +438,14 @@ class SubscriptionHandler {
|
|
|
402
438
|
attributesFilteredWithVersion = true;
|
|
403
439
|
continue;
|
|
404
440
|
}
|
|
405
|
-
attributes.push({ path, value, version, schema: attribute.schema });
|
|
441
|
+
attributes.push({ path, value, version, schema: attribute.schema, attribute });
|
|
406
442
|
} catch (error) {
|
|
407
443
|
logger.error(`Error reading attribute ${this.endpointStructure.resolveAttributeName(path)}:`, error);
|
|
408
444
|
}
|
|
409
445
|
}
|
|
410
446
|
const attributeReportsPayload = attributes.map(
|
|
411
|
-
({ path, schema, value, version }) => ({
|
|
447
|
+
({ path, schema, value, version, attribute }) => ({
|
|
448
|
+
hasFabricSensitiveData: attribute.hasFabricSensitiveData,
|
|
412
449
|
attributeData: {
|
|
413
450
|
path,
|
|
414
451
|
dataVersion: version,
|
|
@@ -417,19 +454,25 @@ class SubscriptionHandler {
|
|
|
417
454
|
}
|
|
418
455
|
})
|
|
419
456
|
);
|
|
420
|
-
attributeErrors.forEach(
|
|
457
|
+
attributeErrors.forEach(
|
|
458
|
+
(attributeStatus) => attributeReportsPayload.push({
|
|
459
|
+
hasFabricSensitiveData: false,
|
|
460
|
+
attributeStatus
|
|
461
|
+
})
|
|
462
|
+
);
|
|
421
463
|
const { newEvents, eventErrors } = this.registerNewEvents();
|
|
422
464
|
let eventsFiltered = false;
|
|
423
465
|
const eventReportsPayload = new Array();
|
|
424
466
|
for (const { path, event } of newEvents) {
|
|
425
467
|
const { schema } = event;
|
|
426
468
|
try {
|
|
427
|
-
const matchingEvents = await readEvent(path, event, this.eventFilters);
|
|
469
|
+
const matchingEvents = await this.readEvent(path, event, this.eventFilters);
|
|
428
470
|
if (matchingEvents.length === 0) {
|
|
429
471
|
eventsFiltered = true;
|
|
430
472
|
} else {
|
|
431
473
|
matchingEvents.forEach(({ eventNumber, priority, epochTimestamp, data }) => {
|
|
432
474
|
eventReportsPayload.push({
|
|
475
|
+
hasFabricSensitiveData: event.hasFabricSensitiveData,
|
|
433
476
|
eventData: {
|
|
434
477
|
path,
|
|
435
478
|
eventNumber,
|
|
@@ -462,32 +505,65 @@ class SubscriptionHandler {
|
|
|
462
505
|
import_StatusCode.StatusCode.InvalidAction
|
|
463
506
|
);
|
|
464
507
|
}
|
|
465
|
-
eventErrors.forEach(
|
|
508
|
+
eventErrors.forEach(
|
|
509
|
+
(eventStatus) => eventReportsPayload.push({
|
|
510
|
+
hasFabricSensitiveData: false,
|
|
511
|
+
eventStatus
|
|
512
|
+
})
|
|
513
|
+
);
|
|
466
514
|
logger.debug(
|
|
467
515
|
`Initialize Subscription with ${attributes.length} attributes and ${eventReportsPayload.length} events.`
|
|
468
516
|
);
|
|
469
517
|
this.lastUpdateTimeMs = import_Time.Time.nowMs();
|
|
470
|
-
await messenger.sendDataReport(
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
518
|
+
await messenger.sendDataReport(
|
|
519
|
+
{
|
|
520
|
+
suppressResponse: false,
|
|
521
|
+
subscriptionId: this.subscriptionId,
|
|
522
|
+
interactionModelRevision: import_InteractionServer.INTERACTION_MODEL_REVISION,
|
|
523
|
+
attributeReportsPayload,
|
|
524
|
+
// TODO Return compressed response once https://github.com/project-chip/connectedhomeip/issues/29359 is solved
|
|
525
|
+
eventReportsPayload
|
|
526
|
+
},
|
|
527
|
+
this.isFabricFiltered
|
|
528
|
+
);
|
|
478
529
|
}
|
|
479
530
|
attributeChangeListener(path, schema, version, value) {
|
|
531
|
+
const changeResult = this.attributeChangeHandler(path, schema, version, value);
|
|
532
|
+
if (import_Promises.MaybePromise.is(changeResult)) {
|
|
533
|
+
const resolver = Promise.resolve(changeResult).catch((error) => logger.error(`Error handling attribute change:`, error)).finally(() => this.attributeUpdatePromises.delete(resolver));
|
|
534
|
+
this.attributeUpdatePromises.add(resolver);
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
attributeChangeHandler(path, schema, version, value) {
|
|
480
538
|
const attributeListenerData = this.attributeListeners.get((0, import_InteractionServer.attributePathToId)(path));
|
|
481
539
|
if (attributeListenerData === void 0) return;
|
|
482
540
|
const { attribute } = attributeListenerData;
|
|
483
541
|
if (attribute instanceof import_AttributeServer.FabricScopedAttributeServer) {
|
|
484
|
-
|
|
542
|
+
return this.readAttribute(path, attribute).then(({ value: value2 }) => {
|
|
543
|
+
this.outstandingAttributeUpdates.set((0, import_InteractionServer.attributePathToId)(path), {
|
|
544
|
+
attribute,
|
|
545
|
+
path,
|
|
546
|
+
schema,
|
|
547
|
+
version,
|
|
548
|
+
value: value2
|
|
549
|
+
});
|
|
550
|
+
this.prepareDataUpdate();
|
|
551
|
+
});
|
|
485
552
|
}
|
|
486
|
-
this.outstandingAttributeUpdates.set((0, import_InteractionServer.attributePathToId)(path), { path, schema, version, value });
|
|
553
|
+
this.outstandingAttributeUpdates.set((0, import_InteractionServer.attributePathToId)(path), { attribute, path, schema, version, value });
|
|
487
554
|
this.prepareDataUpdate();
|
|
488
555
|
}
|
|
489
556
|
eventChangeListener(path, schema, newEvent) {
|
|
490
|
-
this.
|
|
557
|
+
const eventListenerData = this.eventListeners.get((0, import_InteractionServer.eventPathToId)(path));
|
|
558
|
+
if (eventListenerData === void 0) return;
|
|
559
|
+
const { event } = eventListenerData;
|
|
560
|
+
if (event instanceof import_EventServer.FabricSensitiveEventServer) {
|
|
561
|
+
const { data } = newEvent;
|
|
562
|
+
if ((0, import_Type.isObject)(data) && "fabricIndex" in data && data.fabricIndex !== this.session.fabric?.fabricIndex) {
|
|
563
|
+
return;
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
this.outstandingEventUpdates.add({ event, path, schema, data: newEvent });
|
|
491
567
|
if (path.isUrgent) {
|
|
492
568
|
this.prepareDataUpdate();
|
|
493
569
|
}
|
|
@@ -503,6 +579,11 @@ class SubscriptionHandler {
|
|
|
503
579
|
}
|
|
504
580
|
async cancel(flush = false, cancelledByPeer = false) {
|
|
505
581
|
this.sendUpdatesActivated = false;
|
|
582
|
+
if (this.attributeUpdatePromises.size) {
|
|
583
|
+
const resolvers = [...this.attributeUpdatePromises.values()];
|
|
584
|
+
this.attributeUpdatePromises.clear();
|
|
585
|
+
await Promise.all(resolvers);
|
|
586
|
+
}
|
|
506
587
|
this.updateTimer.stop();
|
|
507
588
|
this.sendDelayTimer.stop();
|
|
508
589
|
this.unregisterAttributeListeners(Array.from(this.attributeListeners.keys()));
|
|
@@ -532,39 +613,50 @@ class SubscriptionHandler {
|
|
|
532
613
|
await (0, import_TryCatchHandler.tryCatchAsync)(
|
|
533
614
|
async () => {
|
|
534
615
|
if (attributes.length === 0 && events.length === 0) {
|
|
535
|
-
await messenger.sendDataReport(
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
616
|
+
await messenger.sendDataReport(
|
|
617
|
+
{
|
|
618
|
+
suppressResponse: true,
|
|
619
|
+
// suppressResponse ok for empty DataReports
|
|
620
|
+
subscriptionId: this.subscriptionId,
|
|
621
|
+
interactionModelRevision: import_InteractionServer.INTERACTION_MODEL_REVISION
|
|
622
|
+
},
|
|
623
|
+
this.isFabricFiltered
|
|
624
|
+
);
|
|
541
625
|
} else {
|
|
542
|
-
await messenger.sendDataReport(
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
path,
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
626
|
+
await messenger.sendDataReport(
|
|
627
|
+
{
|
|
628
|
+
suppressResponse: false,
|
|
629
|
+
subscriptionId: this.subscriptionId,
|
|
630
|
+
interactionModelRevision: import_InteractionServer.INTERACTION_MODEL_REVISION,
|
|
631
|
+
// TODO Return compressed response once https://github.com/project-chip/connectedhomeip/issues/29359 is solved
|
|
632
|
+
attributeReportsPayload: attributes.map(
|
|
633
|
+
({ path, schema, value, version, attribute }) => ({
|
|
634
|
+
hasFabricSensitiveData: attribute.hasFabricSensitiveData,
|
|
635
|
+
attributeData: {
|
|
636
|
+
path,
|
|
637
|
+
dataVersion: version,
|
|
638
|
+
schema,
|
|
639
|
+
payload: value
|
|
640
|
+
}
|
|
641
|
+
})
|
|
642
|
+
),
|
|
643
|
+
eventReportsPayload: events.map(({ path, schema, event, data }) => {
|
|
644
|
+
const { eventNumber, priority, epochTimestamp, data: payload } = data;
|
|
645
|
+
return {
|
|
646
|
+
hasFabricSensitiveData: event.hasFabricSensitiveData,
|
|
647
|
+
eventData: {
|
|
648
|
+
path,
|
|
649
|
+
eventNumber,
|
|
650
|
+
priority,
|
|
651
|
+
epochTimestamp,
|
|
652
|
+
schema,
|
|
653
|
+
payload
|
|
654
|
+
}
|
|
655
|
+
};
|
|
565
656
|
})
|
|
566
|
-
|
|
567
|
-
|
|
657
|
+
},
|
|
658
|
+
this.isFabricFiltered
|
|
659
|
+
);
|
|
568
660
|
}
|
|
569
661
|
},
|
|
570
662
|
import_StatusCode.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
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA,6BAAgE;AAEhE,yBAA8B;AAC9B,6BAAwC;AACxC,yBAA4B;AAG5B,oBAAuB;AACvB,qBAA6B;AAE7B,kBAA4B;AAE5B,6BAAgD;AAIhD,kCAA2C;AAS3C,+BAUO;AACP,wBAAgD;AA3ChD;AAAA;AAAA;AAAA;AAAA;AA8CA,MAAM,SAAS,qBAAO,IAAI,qBAAqB;AAexC,MAAM,oBAAoB;AAAA,EAiC7B,YACa,gBACQ,SACA,mBACA,mBACA,oBACA,eACA,cACA,cACA,kBACjB,kBACA,oBACiB,gBACjB,qBACF;AAbW;AACQ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AA5CrB,SAAQ,mBAAmB;AAG3B,SAAiB,8BAA8B,oBAAI,IAAgD;AACnG,SAAiB,0BAA0B,oBAAI,IAAiC;AAChF,SAAiB,qBAAqB,oBAAI,IAMxC;AACF,SAAiB,iBAAiB,oBAAI,IAMpC;AACF,SAAQ,uBAAuB;AAS/B,SAAQ,0BAA0B;AAClC,SAAQ,4BAA4B;AACpC,SAAQ,yBAAyB;AAiB7B,SAAK,SAAS,KAAK,QAAQ;AAC3B,SAAK,SAAS,KAAK,QAAQ;AAC3B,SAAK,aAAa,KAAK,QAAQ;AAC/B,SAAK,qBAAqB,mBAAmB;AAC7C,SAAK,uBAAuB,qBAAqB;AAEjD,UAAM,EAAE,aAAa,aAAa,IAAI,KAAK;AAAA,MACvC,oBAAoB,qBAAqB;AAAA,M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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,6BAAgE;AAChE,yBAA2D;AAC3D,yBAA8B;AAC9B,6BAAwC;AACxC,yBAA4B;AAG5B,oBAAuB;AACvB,qBAA6B;AAE7B,kBAA4B;AAE5B,sBAA6B;AAC7B,kBAAyB;AACzB,6BAAgD;AAIhD,kCAA2C;AAS3C,+BAUO;AACP,wBAAgD;AA7ChD;AAAA;AAAA;AAAA;AAAA;AAgDA,MAAM,SAAS,qBAAO,IAAI,qBAAqB;AAiBxC,MAAM,oBAAoB;AAAA,EAkD7B,YAAY,SAmBT;AApDH,SAAQ,mBAAmB;AAG3B,SAAiB,8BAA8B,o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