Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
-->

## __WORK IN PROGRESS__
* (@foxriver76) updated plugin base and sentry plugin to version 2
* (@foxriver76) enhanced translations for the `diskSpaceIssues` notification category
* (@foxriver76) improved backup/restore process to work for arbitrary large installations

Expand Down
31,555 changes: 16,370 additions & 15,185 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions packages/adapter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
"@iobroker/db-states-redis": "file:../db-states-redis",
"@iobroker/js-controller-common": "file:../common",
"@iobroker/js-controller-common-db": "file:../common-db",
"@iobroker/plugin-base": "~1.2.1",
"@iobroker/plugin-sentry": "~1.2.1",
"@iobroker/plugin-base": "~2.0.1",
"deep-clone": "^3.0.3",
"fs-extra": "^11.1.0",
"jsonwebtoken": "^9.0.0",
Expand Down
516 changes: 255 additions & 261 deletions packages/adapter/src/lib/adapter/adapter.ts

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"dependencies": {
"@iobroker/js-controller-common": "file:../common",
"@iobroker/js-controller-common-db": "file:../common-db",
"@iobroker/plugin-base": "~2.0.1",
"axios": "^1.7.4",
"chokidar": "^3.5.3",
"debug": "^4.3.4",
Expand Down
4 changes: 1 addition & 3 deletions packages/cli/src/lib/setup/dbConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -413,9 +413,7 @@ function initializePlugins(config: Record<string, any>): Promise<void> {
pluginHandler.addPlugins(config.plugins, tools.getControllerDir()); // ... plugins from iobroker.json
pluginHandler.setDatabaseForPlugins(objects, states);

return new Promise(resolve => {
pluginHandler.initPlugins(ioPackage, () => resolve());
});
return pluginHandler.initPlugins(ioPackage);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions packages/controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
"@iobroker/js-controller-cli": "file:../cli",
"@iobroker/js-controller-common": "file:../common",
"@iobroker/js-controller-common-db": "file:../common-db",
"@iobroker/plugin-base": "~1.2.1",
"@iobroker/plugin-sentry": "~1.2.1",
"@iobroker/plugin-base": "~2.0.1",
"@iobroker/plugin-sentry": "~2.0.4",
"axios": "^1.7.4",
"cron-parser": "^4.9.0",
"debug": "^4.3.4",
Expand Down
29 changes: 15 additions & 14 deletions packages/controller/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import {
SYSTEM_REPOSITORIES_ID
} from '@iobroker/js-controller-common-db/constants';
import { PluginHandler } from '@iobroker/plugin-base';
import type SentryPlugin from '@iobroker/plugin-sentry';
import { BlocklistManager } from '@/lib/blocklistManager.js';
import type { Client as ObjectsClient } from '@iobroker/db-objects-redis';
import type { Client as StatesClient } from '@iobroker/db-states-redis';
Expand Down Expand Up @@ -616,8 +617,8 @@ function createStates(onConnect: () => void): void {
}
if (pluginHandler.isPluginActive(pluginName) !== state.val) {
if (state.val) {
if (!pluginHandler.isPluginInstanciated(pluginName)) {
pluginHandler.instanciatePlugin(
if (!pluginHandler.isPluginInstantiated(pluginName)) {
pluginHandler.instantiatePlugin(
pluginName,
pluginHandler.getPluginConfig(pluginName)!,
controllerDir
Expand Down Expand Up @@ -712,16 +713,15 @@ async function initializeController(): Promise<void> {
connected = true;
if (!isStopping) {
pluginHandler.setDatabaseForPlugins(objects, states);
pluginHandler.initPlugins(ioPackage, async () => {
states!.subscribe(`${hostObjectPrefix}.plugins.*`);

// Do not start if we're still stopping the instances
await checkHost();
startMultihost(config);
setMeta();
started = true;
getInstances();
});
await pluginHandler.initPlugins(ioPackage);
states!.subscribe(`${hostObjectPrefix}.plugins.*`);

// Do not start if we're still stopping the instances
await checkHost();
startMultihost(config);
setMeta();
started = true;
getInstances();
}
} else {
connected = true;
Expand Down Expand Up @@ -3015,8 +3015,9 @@ async function processMessage(msg: ioBroker.SendableMessage): Promise<null | voi
const level: string = msg.message.level;
const extraInfo: Record<string, unknown> = msg.message.extraInfo;

// @ts-expect-error Plugin is not well typed and SentryPlugin has no types at all currently
const sentryObj = pluginHandler.getPluginInstance('sentry')?.getSentryObject();
const sentryObj = (
pluginHandler.getPluginInstance('sentry') as InstanceType<typeof SentryPlugin> | null
)?.getSentryObject();

if (!sentryObj) {
logger.debug(`${hostLogPrefix} Do not send message "${message}" to Sentry, because it is disabled`);
Expand Down