matterbridge 2.1.2-dev.3 → 2.1.3-dev.1

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/CHANGELOG.md CHANGED
@@ -15,11 +15,11 @@ Tamer (https://github.com/tammeryousef1006) has created the Matterbridge Discord
15
15
 
16
16
  ### Breaking Changes
17
17
 
18
- Starting from v. 2.0.0 Matterbridge is running only in mode edge (no parameter needed and no badge in the frontend).
18
+ Starting from v. 2.0.0, Matterbridge is running only in mode edge (no parameter needed and no badge in the frontend).
19
19
 
20
- With this release v. 2.1.0, the legacy old api of matter.js have been completely removed from Matterbridge and from all plugins.
20
+ Starting from v. 2.1.0, the legacy old api of matter.js have been completely removed from Matterbridge and from all plugins.
21
21
 
22
- For this reason there is no compatibility for old versions of the plugins.
22
+ For this reason there is no compatibility with the old versions of the plugins.
23
23
 
24
24
  You need to update all plugins you use and Matterbridge in the same moment.
25
25
 
@@ -31,14 +31,28 @@ matterbridge-zigbee2mqtt v. 2.4.4
31
31
  matterbridge-somfy-tahoma v. 1.2.3
32
32
  matterbridge-hass v. 0.0.8
33
33
 
34
+ ## [2.1.3] - 2025-02-04
35
+
36
+ ### Added
37
+
38
+ - [matter.js]: Added temporary solution to serverNode.close() not returning.
39
+
40
+ ### Changed
41
+
42
+ - [package]: Update dependencies.
43
+
44
+ <a href="https://www.buymeacoffee.com/luligugithub">
45
+ <img src="./yellow-button.png" alt="Buy me a coffee" width="120">
46
+ </a>
47
+
34
48
  ## [2.1.2] - 2025-02-03
35
49
 
36
50
  ### Added
37
51
 
38
- - [frotnend]: Add rss and heap to SystemInformation.
39
- - [memorydump]: Add cpu to memoryDump.
40
- - [memorydump]: Add memoryinterval to memoryDump.
41
- - [memorydump]: Add memorytimeout to memoryDump.
52
+ - [frontend]: Added rss and heap to SystemInformation.
53
+ - [memorydump]: Added cpu to memoryDump.
54
+ - [memorydump]: Added memoryinterval to memoryDump.
55
+ - [memorydump]: Added memorytimeout to memoryDump.
42
56
 
43
57
  ### Fixed
44
58
 
@@ -62,9 +76,9 @@ matterbridge-hass v. 0.0.8
62
76
 
63
77
  ### Added
64
78
 
65
- - [matterbridge]: Add MatterbridgeModeSelectServer.
66
- - [matterbridge]: Add MatterbridgeSwitchServer.
67
- - [frontend]: Add api/advertise to turn on matter advertising in bridge mode.
79
+ - [matterbridge]: Added MatterbridgeModeSelectServer.
80
+ - [matterbridge]: Added MatterbridgeSwitchServer.
81
+ - [frontend]: Added api/advertise to turn on matter advertising in bridge mode.
68
82
  - [frontend]: Frontend v.2.4.0.
69
83
  - [matterbridge]: Added deep memory scan details.
70
84
 
@@ -142,6 +142,9 @@ export class Matterbridge extends EventEmitter {
142
142
  }
143
143
  async destroyInstance() {
144
144
  await this.cleanup('destroying instance...', false);
145
+ await new Promise((resolve) => {
146
+ setTimeout(resolve, 1000);
147
+ });
145
148
  }
146
149
  async initialize() {
147
150
  if (hasParameter('service'))
@@ -996,7 +999,7 @@ export class Matterbridge extends EventEmitter {
996
999
  this.log.debug(`Plugin ${plg}${plugin.name}${db} reachability timeout cleared`);
997
1000
  }
998
1001
  }
999
- this.frontend.stop();
1002
+ await this.frontend.stop();
1000
1003
  this.log.notice(`Stopping matter server nodes in ${this.bridgeMode} mode...`);
1001
1004
  if (this.bridgeMode === 'bridge') {
1002
1005
  if (this.serverNode) {
@@ -1483,8 +1486,27 @@ export class Matterbridge extends EventEmitter {
1483
1486
  if (!matterServerNode)
1484
1487
  return;
1485
1488
  this.log.notice(`Closing ${matterServerNode.id} server node`);
1486
- await matterServerNode.close();
1487
- this.log.info(`Closed ${matterServerNode.id} server node`);
1489
+ const withTimeout = (promise, ms) => {
1490
+ return new Promise((resolve, reject) => {
1491
+ const timer = setTimeout(() => reject(new Error('Operation timed out')), ms);
1492
+ promise
1493
+ .then((result) => {
1494
+ clearTimeout(timer);
1495
+ resolve(result);
1496
+ })
1497
+ .catch((error) => {
1498
+ clearTimeout(timer);
1499
+ reject(error);
1500
+ });
1501
+ });
1502
+ };
1503
+ try {
1504
+ await withTimeout(matterServerNode.close(), 5000);
1505
+ this.log.info(`Closed ${matterServerNode.id} server node`);
1506
+ }
1507
+ catch (error) {
1508
+ this.log.error(`Failed to close ${matterServerNode.id} server node: ${error instanceof Error ? error.message : error}`);
1509
+ }
1488
1510
  }
1489
1511
  async advertiseServerNode(matterServerNode) {
1490
1512
  if (matterServerNode && matterServerNode.lifecycle.isCommissioned) {
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "matterbridge",
3
- "version": "2.1.2-dev.3",
3
+ "version": "2.1.3-dev.1",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "matterbridge",
9
- "version": "2.1.2-dev.3",
9
+ "version": "2.1.3-dev.1",
10
10
  "license": "Apache-2.0",
11
11
  "dependencies": {
12
12
  "@matter/main": "0.12.2",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "matterbridge",
3
- "version": "2.1.2-dev.3",
3
+ "version": "2.1.3-dev.1",
4
4
  "description": "Matterbridge plugin manager for Matter",
5
5
  "author": "https://github.com/Luligu",
6
6
  "license": "Apache-2.0",