@matterbridge/thread 3.7.5-dev-20260425-d7f022f → 3.7.6-dev-20260426-a7ce6ee

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.
@@ -5,7 +5,7 @@ import path, { resolve } from 'node:path';
5
5
  import { fileURLToPath, pathToFileURL } from 'node:url';
6
6
  import { Worker } from 'node:worker_threads';
7
7
  import { hasParameter } from '@matterbridge/utils/cli';
8
- import { AnsiLogger, CYAN, db, debugStringify, MAGENTA } from 'node-ansi-logger';
8
+ import { AnsiLogger, CYAN, db, debugStringify, MAGENTA, wr } from 'node-ansi-logger';
9
9
  import { BroadcastServer } from './broadcastServer.js';
10
10
  export class ThreadsManager {
11
11
  debug;
@@ -72,7 +72,7 @@ export class ThreadsManager {
72
72
  this.server.respond({ ...msg, result: { success: true } });
73
73
  }
74
74
  catch (err) {
75
- this.log.warn(`Failed to run thread ${CYAN}${msg.params.name}${db}: ${err.message}`);
75
+ this.log.warn(`Failed to run thread ${CYAN}${msg.params.name}${wr}: ${err.message}`);
76
76
  this.server.respond({ ...msg, result: { success: false } });
77
77
  }
78
78
  break;
@@ -27,10 +27,14 @@ export default new WorkerWrapper('DockerVersion', async (worker) => {
27
27
  const errorMessage = inspectError(worker.log, `Failed to check docker version`, error);
28
28
  worker.logger("error", errorMessage);
29
29
  }
30
- if (dockerBuildConfig && dockerBuildConfig.dev === false && dockerVersionLatest && dockerBuildConfig.version !== dockerVersionLatest)
31
- worker.logger("warn", `You are using the v.${dockerBuildConfig.version} latest Docker image. Please pull the latest Docker image v.${dockerVersionLatest}.`);
32
- if (dockerBuildConfig && dockerBuildConfig.dev === true && dockerVersionDev && dockerBuildConfig.version !== dockerVersionDev)
33
- worker.logger("warn", `You are using the v.${dockerBuildConfig.version} dev Docker image. Please pull the dev Docker image v.${dockerVersionDev}.`);
30
+ if (dockerBuildConfig && dockerBuildConfig.dev === false && dockerVersionLatest && dockerBuildConfig.version !== dockerVersionLatest) {
31
+ worker.logger("warn", `You are using the v.${dockerBuildConfig.version} latest Docker image. Please pull the latest Docker image v.${dockerVersionLatest} and recreate the container to apply it.`);
32
+ worker.snackBar(`A new Docker image is available: v.${dockerVersionLatest}. Pull the latest Docker image and recreate the container to apply it.`, 0, 'info');
33
+ }
34
+ if (dockerBuildConfig && dockerBuildConfig.dev === true && dockerVersionDev && dockerBuildConfig.version !== dockerVersionDev) {
35
+ worker.logger("warn", `You are using the v.${dockerBuildConfig.version} dev Docker image. Please pull the dev Docker image v.${dockerVersionDev} and recreate the container to apply it.`);
36
+ worker.snackBar(`A new dev Docker image is available: v.${dockerVersionDev}. Pull the dev Docker image and recreate the container to apply it.`, 0, 'info');
37
+ }
34
38
  worker.server.request({
35
39
  type: 'matterbridge_docker_version',
36
40
  src: `manager`,
@@ -7,19 +7,23 @@ export default new WorkerWrapper('SystemCheck', async (worker) => {
7
7
  let success = false;
8
8
  try {
9
9
  const shared = (await worker.server.fetch({ type: 'matterbridge_shared', src: `matterbridge`, dst: 'matterbridge' }, 1000)).result.data;
10
+ const logSnackBarError = (level, message) => {
11
+ worker.logger(level, message);
12
+ worker.snackBar(message, 0, 'error');
13
+ };
10
14
  if (process.env.NVM_BIN && process.env.NVM_DIR)
11
- worker.logger("error", `NVM is a development tool and is not supported in production. Please install node from https://github.com/nodesource/distributions.`);
15
+ logSnackBarError("error", `System Check: NVM is a development tool and is not supported in production. Please install node from https://github.com/nodesource/distributions.`);
12
16
  const nodeVersion = process.versions.node;
13
17
  const versionMajor = parseInt(nodeVersion.split('.')[0]);
14
18
  const versionMinor = parseInt(nodeVersion.split('.')[1]);
15
19
  const versionPatch = parseInt(nodeVersion.split('.')[2]);
16
20
  worker.logger("debug", `Node.js Version: ${versionMajor}.${versionMinor}.${versionPatch}`);
17
21
  if (versionMajor === 20 && versionMinor < 19)
18
- worker.logger("error", `Node.js version < 20.19.0 is not supported. Please upgrade to Node.js LTS version (24.x).`);
22
+ logSnackBarError("error", `System Check: Node.js version < 20.19.0 is not supported. Please upgrade to Node.js LTS version (24.x).`);
19
23
  if (versionMajor === 22 && versionMinor < 13)
20
- worker.logger("error", `Node.js version < 22.13.0 is not supported. Please upgrade to Node.js LTS version (24.x).`);
24
+ logSnackBarError("error", `System Check: Node.js version < 22.13.0 is not supported. Please upgrade to Node.js LTS version (24.x).`);
21
25
  if (versionMajor === 21 || versionMajor === 23 || versionMajor === 25)
22
- worker.logger("error", `Node.js odd major versions are not supported. Please upgrade to Node.js LTS version (24.x).`);
26
+ logSnackBarError("error", `System Check: Node.js odd major versions are not supported. Please upgrade to Node.js LTS version (24.x).`);
23
27
  if (versionMajor !== 24)
24
28
  worker.logger("notice", `You are running Node.js ${versionMajor}.${versionMinor}.${versionPatch}. Please consider upgrading to Node.js LTS version (24.x).`);
25
29
  const networkInterfaces = os.networkInterfaces();
@@ -27,9 +31,12 @@ export default new WorkerWrapper('SystemCheck', async (worker) => {
27
31
  let foundExternal = false;
28
32
  let foundIpv4 = false;
29
33
  let foundIpv6 = false;
34
+ let foundExcluded = false;
30
35
  for (const [interfaceName, interfaceDetails] of Object.entries(networkInterfaces)) {
31
- if (!shared.mdnsInterface && excludedInterfaceNamePattern.test(interfaceName))
32
- worker.logger("warn", `Found network interface '${interfaceName}'. Please use --mdnsinterface parameter to specify the correct local interface for mDNS.`);
36
+ if (!shared.mdnsInterface && excludedInterfaceNamePattern.test(interfaceName)) {
37
+ worker.logger("warn", `System Check: Found network interface '${interfaceName}'. Please use --mdnsinterface parameter or set Mdns interface in Settings to specify the correct local interface for Matter mDNS.`);
38
+ foundExcluded = true;
39
+ }
33
40
  if (excludedInterfaceNamePattern.test(interfaceName))
34
41
  continue;
35
42
  for (const detail of interfaceDetails || []) {
@@ -43,14 +50,21 @@ export default new WorkerWrapper('SystemCheck', async (worker) => {
43
50
  foundIpv6 = true;
44
51
  }
45
52
  }
46
- if (!foundInternal)
47
- worker.logger("error", `No internal network interface found. Check your network configuration.`);
48
- if (!foundExternal)
49
- worker.logger("error", `No external network interface found. Check your network configuration.`);
50
- if (!foundIpv4)
51
- worker.logger("error", `No IPv4 network interface found. Check your network configuration.`);
52
- if (!foundIpv6)
53
- worker.logger("error", `No IPv6 network interface found. Check your network configuration.`);
53
+ if (!foundInternal) {
54
+ logSnackBarError("error", `System Check: No internal network interface found. Check your network configuration.`);
55
+ }
56
+ if (!foundExternal) {
57
+ logSnackBarError("error", `System Check: No external network interface found. Check your network configuration.`);
58
+ }
59
+ if (!foundIpv4) {
60
+ logSnackBarError("error", `System Check: No IPv4 network interface found. Check your network configuration.`);
61
+ }
62
+ if (!foundIpv6) {
63
+ logSnackBarError("error", `System Check: No IPv6 network interface found. Check your network configuration.`);
64
+ }
65
+ if (foundExcluded) {
66
+ logSnackBarError("error", `System Check: Use --mdnsinterface parameter or set Mdns interface in Settings to specify the correct local interface for Matter mDNS.`);
67
+ }
54
68
  worker.logger("info", `System check succeeded`);
55
69
  success = true;
56
70
  }
@@ -17,5 +17,6 @@ export declare class WorkerWrapper {
17
17
  parentPost(message: ParentPortMessage): void;
18
18
  parentLog(logName: string | undefined, logLevel: LogLevel, message: string): void;
19
19
  logger(level: LogLevel, message: string): void;
20
+ snackBar(message: string, timeout?: number, severity?: 'info' | 'warning' | 'error' | 'success'): void;
20
21
  logWorkerInfo(log: AnsiLogger, logEnv?: boolean): void;
21
22
  }
@@ -116,6 +116,9 @@ export class WorkerWrapper {
116
116
  else
117
117
  AnsiLogger.create({ logName: this.name, logNameColor: MAGENTA, logTimestampFormat: 4, logLevel: ThreadsManager.logLevel }).log(level, message);
118
118
  }
119
+ snackBar(message, timeout = 5, severity = 'info') {
120
+ this.server.request({ type: 'frontend_snackbarmessage', src: 'matterbridge', dst: 'frontend', params: { message, timeout, severity } });
121
+ }
119
122
  logWorkerInfo(log, logEnv = false) {
120
123
  log.debug(`${isMainThread ? 'Main thread' : 'Worker thread'}: ${this.name}:${threadId} Pid: ${process.pid}`);
121
124
  log.debug(`ParentPort: ${parentPort ? 'active' : 'not active'}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@matterbridge/thread",
3
- "version": "3.7.5-dev-20260425-d7f022f",
3
+ "version": "3.7.6-dev-20260426-a7ce6ee",
4
4
  "description": "Matterbridge thread library",
5
5
  "author": "https://github.com/Luligu",
6
6
  "homepage": "https://matterbridge.io/",
@@ -69,8 +69,8 @@
69
69
  "CHANGELOG.md"
70
70
  ],
71
71
  "dependencies": {
72
- "@matterbridge/types": "3.7.5-dev-20260425-d7f022f",
73
- "@matterbridge/utils": "3.7.5-dev-20260425-d7f022f",
72
+ "@matterbridge/types": "3.7.6-dev-20260426-a7ce6ee",
73
+ "@matterbridge/utils": "3.7.6-dev-20260426-a7ce6ee",
74
74
  "@zip.js/zip.js": "2.8.26",
75
75
  "node-ansi-logger": "3.2.1"
76
76
  }