iobroker.eos-admin 9.0.20 → 9.0.21

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.
Files changed (84) hide show
  1. package/NEXOWATT_EOS_BUILD_INFO.json +3 -3
  2. package/README.md +5 -3
  3. package/adminWww/.vite/manifest.json +39 -39
  4. package/adminWww/NEXOWATT_EOS_FRONTEND_MANIFEST.json +107 -107
  5. package/adminWww/assets/{AdapterUpdateDialog-CRD3XVom.js → AdapterUpdateDialog-Dxl_b7Op.js} +1 -1
  6. package/adminWww/assets/{Adapters-Cuf0X0CU.js → Adapters-CVKKhXmI.js} +1 -1
  7. package/adminWww/assets/{ConfigManager-B8ycQt1C.js → ConfigManager-Bf6nTAkL.js} +1 -1
  8. package/adminWww/assets/{Enums-CctVCgZX.js → Enums-CJHVJY7t.js} +1 -1
  9. package/adminWww/assets/{Fields-onm4DfoO.js → Fields-DWHbZKvm.js} +1 -1
  10. package/adminWww/assets/{Files-OLP3Rwc7.js → Files-a6owMTXA.js} +1 -1
  11. package/adminWww/assets/{Hosts-C31oqMcW.js → Hosts-LtEMeXpV.js} +1 -1
  12. package/adminWww/assets/{Instances-DFdvJ9pa.js → Instances-DhChziA1.js} +1 -1
  13. package/adminWww/assets/{Intro-DvsFJxU0.js → Intro-Cyq9gVDC.js} +1 -1
  14. package/adminWww/assets/{Logs-Zqg2Bqv6.js → Logs-wcramXsg.js} +1 -1
  15. package/adminWww/assets/{Objects-CpWZp6yp.js → Objects-DINVHd_e.js} +1 -1
  16. package/adminWww/assets/{Overview-BsKUo298.js → Overview-DK4R41zR.js} +1 -1
  17. package/adminWww/assets/{State-D_xwlhhb.js → State-DcEACXzL.js} +1 -1
  18. package/adminWww/assets/{UsedResources-C79N6yZx.js → UsedResources-C1LcM0Rb.js} +1 -1
  19. package/adminWww/assets/{Users-WgC0O8P0.js → Users-DvDdSyDY.js} +1 -1
  20. package/adminWww/assets/{bootstrap-BcfBoIoa.js → bootstrap-Dbj_GbnP.js} +3 -3
  21. package/adminWww/assets/{hostInit-B7bBV7cH.js → hostInit-BNFIx0-f.js} +1 -1
  22. package/adminWww/assets/{icons-material-D1JYmRTj.js → icons-material-DVbdXNgr.js} +1 -1
  23. package/adminWww/assets/{index-DbiuoDjo.js → index-CoKP1NSA.js} +2 -2
  24. package/adminWww/assets/{installSVGRenderer-BAY-Pzp-.js → installSVGRenderer-CMvku1F1.js} +1 -1
  25. package/adminWww/assets/{mf-entry-bootstrap-0-33384c20.js → mf-entry-bootstrap-0-ac330bce.js} +2 -2
  26. package/adminWww/index.html +23 -23
  27. package/adminWww/mf-manifest.json +1 -1
  28. package/adminWww/mf-stats.json +1 -1
  29. package/adminWww/remoteEntry-eos-9.0.21.js +12 -0
  30. package/adminWww/remoteEntry.js +1 -1
  31. package/build/lib/eosCustomerUpdateHttp.js +203 -0
  32. package/build/lib/eosCustomerUpdateHttp.js.map +1 -0
  33. package/build/lib/eosCustomerUpdateTransport.js +472 -0
  34. package/build/lib/eosCustomerUpdateTransport.js.map +1 -0
  35. package/build/lib/eosCustomerUpdateWorker.js +567 -0
  36. package/build/lib/eosCustomerUpdateWorker.js.map +1 -0
  37. package/build/lib/eosCustomerUpdates.js +631 -0
  38. package/build/lib/eosCustomerUpdates.js.map +1 -0
  39. package/build/lib/eosModuleConfigStore.js +12 -1
  40. package/build/lib/eosModuleConfigStore.js.map +1 -1
  41. package/build/lib/eosModuleHost.js +41 -26
  42. package/build/lib/eosModuleHost.js.map +1 -1
  43. package/build/lib/eosModuleHttp.js +8 -2
  44. package/build/lib/eosModuleHttp.js.map +1 -1
  45. package/build/lib/eosUpdateSnapshot.js +290 -0
  46. package/build/lib/eosUpdateSnapshot.js.map +1 -0
  47. package/build/lib/eosUploadGuard.js +124 -81
  48. package/build/lib/eosUploadGuard.js.map +1 -1
  49. package/build/lib/web.js +80 -0
  50. package/build/lib/web.js.map +1 -1
  51. package/io-package.json +8 -8
  52. package/modules/backup/admin/index.js +4 -1
  53. package/modules/devices/admin/host-bridge.js +5 -1
  54. package/modules/devices/lib/deviceRuntime.js +27 -4
  55. package/modules/devices/lib/drivers/mqtt.js +204 -82
  56. package/modules/devices/lib/drivers/mqttPendingOperations.js +119 -0
  57. package/modules/devices/test/mqttCommandLifecycle.test.js +255 -0
  58. package/modules/devices/test/mqttResourceBounds.test.js +98 -0
  59. package/modules/devices/test/mqttRuntimeSession.test.js +109 -0
  60. package/modules/devices/tsconfig.mqtt-lifecycle.json +20 -0
  61. package/modules/eebus/admin/index.js +6 -3
  62. package/package.json +4 -4
  63. package/release-manifests/unified/build-environment.cdx.json +6 -6
  64. package/release-manifests/unified/files.json +363 -95
  65. package/release-manifests/unified/frontend.cdx.json +6 -6
  66. package/release-manifests/unified/installer.cdx.json +6 -6
  67. package/release-manifests/unified/obsolete-admin-assets.json +66 -0
  68. package/release-manifests/unified/runtime.cdx.json +25 -25
  69. package/release-manifests/unified/validation.json +15 -15
  70. package/tools/eos-release-manifest.cjs +3 -3
  71. package/ui/docs/security/eslint-reviewed-findings.json +83 -27
  72. package/ui/ems/engine.js +14 -3
  73. package/ui/ems/modules/tariff-provider.js +34 -10
  74. package/ui/ems/services/tariff-provider-registry.js +18 -8
  75. package/ui/io-package.json +1 -1
  76. package/ui/main.js +65 -34
  77. package/ui/package.json +1 -1
  78. package/ui/www/app.js +3 -2
  79. package/ui/www/eos-updates.css +15 -0
  80. package/ui/www/eos-updates.js +351 -0
  81. package/ui/www/index.html +2 -0
  82. package/ui/www/manifest.webmanifest +3 -3
  83. package/ui/www/settings.html +34 -0
  84. package/adminWww/remoteEntry-eos-9.0.20.js +0 -12
package/io-package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "eos-admin",
4
- "version": "9.0.20",
4
+ "version": "9.0.21",
5
5
  "titleLang": {
6
6
  "en": "NexoWatt EOS",
7
7
  "de": "NexoWatt EOS",
@@ -18,6 +18,10 @@
18
18
  "connectionType": "local",
19
19
  "dataSource": "push",
20
20
  "news": {
21
+ "9.0.21": {
22
+ "de": "Stabilität bei Wiederverbindungen, verspäteten Schreibaufträgen, Speicherfarm und Tarifausfällen verbessert; konkurrierende Geräteänderungen abgesichert. EOS-Updates in den Kundeneinstellungen ergänzt.",
23
+ "en": "Improve reconnect, delayed-write, storage-farm and tariff-outage stability; protect concurrent device edits. Add EOS updates to customer settings."
24
+ },
21
25
  "9.0.20": {
22
26
  "en": "Fix browser-independent device commands, storage-farm feedback and dynamic limits; add direct InfluxDB 2 history with protected credentials and improve login/home-screen icons. Preserve customer configuration.",
23
27
  "de": "Gerätebefehle unabhängig vom Browser, Farm-Rückmeldungen und dynamische Grenzen korrigiert; direkte InfluxDB-2-Historie sowie Login- und Home-Bildschirm-Symbole ergänzt. Kundeneinstellungen bleiben erhalten."
@@ -96,10 +100,6 @@
96
100
  "9.0.2": {
97
101
  "en": "Fix license storage for supported ioBroker runtime permissions; add authorized public-key recovery and visible activation diagnostics.",
98
102
  "de": "Lizenzspeicherung für ioBroker-Laufzeitrechte korrigiert; autorisierte Prüfschlüssel-Wiederherstellung und sichtbare Aktivierungsdiagnose ergänzt."
99
- },
100
- "9.0.1": {
101
- "en": "Preserve existing ioBroker Admin access, use a fixed authenticated HTTPS listener, and reject TLS downgrade and port hopping.",
102
- "de": "Bestehenden ioBroker-Admin erhalten; fester HTTPS-Port mit Anmeldung; kein TLS-Rückfall und kein automatischer Portwechsel."
103
103
  }
104
104
  },
105
105
  "desc": {
@@ -137,7 +137,7 @@
137
137
  "icon": "admin.svg",
138
138
  "messagebox": true,
139
139
  "enabled": true,
140
- "extIcon": "https://unpkg.com/iobroker.eos-admin@9.0.20/admin/admin.svg",
140
+ "extIcon": "https://unpkg.com/iobroker.eos-admin@9.0.21/admin/admin.svg",
141
141
  "keywords": [
142
142
  "NexoWatt",
143
143
  "EOS",
@@ -148,7 +148,7 @@
148
148
  "licensed"
149
149
  ],
150
150
  "compact": false,
151
- "readme": "https://unpkg.com/iobroker.eos-admin@9.0.20/README.md",
151
+ "readme": "https://unpkg.com/iobroker.eos-admin@9.0.21/README.md",
152
152
  "authors": [
153
153
  "NexoWatt"
154
154
  ],
@@ -160,7 +160,7 @@
160
160
  "type": "general",
161
161
  "licenseInformation": {
162
162
  "type": "paid",
163
- "link": "https://unpkg.com/iobroker.eos-admin@9.0.20/LICENSE"
163
+ "link": "https://unpkg.com/iobroker.eos-admin@9.0.21/LICENSE"
164
164
  },
165
165
  "logTransporter": true,
166
166
  "stopBeforeUpdate": true,
@@ -3,6 +3,7 @@
3
3
  (() => {
4
4
  const api = '/api/eos/modules/backup';
5
5
  let config = {},
6
+ configurationRevision = '',
6
7
  csrf = '',
7
8
  busy = false,
8
9
  poll = null;
@@ -25,6 +26,7 @@
25
26
  throw new Error('EOS antwortet derzeit nicht. Bitte Status erneut laden.');
26
27
  }
27
28
  if (!r.ok) {
29
+ if (v.error === 'EOS_MODULE_CONFIG_CONFLICT') throw new Error('Die Sicherungseinstellungen wurden inzwischen geändert. Deine Eingaben bleiben erhalten. Seite neu laden und Änderungen mit dem gespeicherten Stand abgleichen.');
28
30
  if (r.status === 401)
29
31
  throw new Error(
30
32
  'Sitzung abgelaufen. Bitte erneut bei EOS anmelden; ungespeicherte Eingaben bleiben hier erhalten.',
@@ -179,6 +181,7 @@
179
181
  csrf = v.csrfToken || csrf;
180
182
  if (replace) {
181
183
  config = v.config || {};
184
+ configurationRevision = typeof v.configurationRevision === 'string' ? v.configurationRevision : '';
182
185
  fill();
183
186
  }
184
187
  render(v);
@@ -207,7 +210,7 @@
207
210
  ? JSON.parse(e.value)
208
211
  : e.value;
209
212
  }
210
- const v = await request('', 'PUT', { config: next });
213
+ const v = await request('', 'PUT', { config: next, expectedConfigurationRevision: configurationRevision });
211
214
  config = v.config;
212
215
  message('Einstellungen gespeichert.');
213
216
  await load(true);
@@ -17,6 +17,7 @@ function translateAll() {
17
17
  const endpoint = '/api/eos/modules/devices';
18
18
  let csrfToken = '';
19
19
  let originalConfig = {};
20
+ let configurationRevision = '';
20
21
  let ready = false;
21
22
  let busy = false;
22
23
  let manualImportAllowed = false;
@@ -33,6 +34,8 @@ function translateAll() {
33
34
  EOS_MODULE_CONFIG_UNAVAILABLE: 'Die gespeicherten Geräteeinstellungen konnten nicht gelesen werden. Es wird kein leerer Ersatz gespeichert. Verbindung und ioBroker-Protokoll prüfen und anschließend „Neu laden“ wählen.',
34
35
  EOS_MODULE_CONFIG_STORE_INVALID: 'Der gespeicherte Gerätestand konnte nicht sicher geprüft werden. Die Bearbeitung ist gesperrt; bestehende Einstellungen bleiben erhalten. Bitte das ioBroker-Protokoll und die Sicherung prüfen.',
35
36
  EOS_MODULE_CONFIG_DECRYPTION: 'Der gespeicherte Gerätestand konnte nicht entschlüsselt werden. Die Bearbeitung ist gesperrt; bestehende Einstellungen bleiben erhalten. Bitte den ursprünglichen ioBroker-Systemschlüssel und die Sicherung prüfen.',
37
+ EOS_MODULE_CONFIG_CONFLICT: 'Die Geräteeinstellungen wurden inzwischen geändert. Deine Eingaben bleiben im Formular; vor erneutem Speichern den aktuellen Stand neu laden und die Änderungen abgleichen.',
38
+ EOS_MODULE_TIMEOUT: 'Die Speicherbestätigung dauert länger. Der Auftrag kann noch abgeschlossen werden. Deine Eingaben bleiben erhalten; zunächst den gespeicherten Stand neu laden und prüfen.',
36
39
  EOS_MODULE_IMPORT_REQUIRES_DISABLED: 'Für den manuellen Import muss das gespeicherte Gerätemodul deaktiviert sein. Haken bei „Gerätemodul aktivieren“ entfernen und „Speichern und übernehmen“ wählen. Für eine 1:1-Bestandsübernahme zuerst deren Status prüfen.',
37
40
  EOS_MODULE_IMPORT_ALREADY_MIGRATED: 'Die automatische Bestandsübernahme erhält bereits die ursprünglichen Datenpunkt-IDs. Ein erneuter manueller Import ist gesperrt. Bitte den Status der Bestandsübernahme prüfen.',
38
41
  EOS_MODULE_LEGACY_RUNNING: 'Der bisherige Geräteadapter läuft noch oder sein vollständiger Stopp ist nicht bestätigt. Für die 1:1-Übernahme bitte den Bestandsstatus prüfen; ein manueller Import benötigt eine bestätigte, deaktivierte alte Instanz.',
@@ -167,6 +170,7 @@ function translateAll() {
167
170
  if (!result.config || typeof result.csrfToken !== 'string') throw new Error('EOS_DEVICES_INVALID_RESPONSE');
168
171
  csrfToken = result.csrfToken;
169
172
  originalConfig = result.config;
173
+ configurationRevision = typeof result.configurationRevision === 'string' ? result.configurationRevision : '';
170
174
  window.EosDeviceEms?.setDevices?.(result.config.devices);
171
175
  element('eosModuleEnabled').checked = result.config.enabled === true;
172
176
  ready = false;
@@ -226,7 +230,7 @@ function translateAll() {
226
230
  if (window.EosDeviceEms?.prepareSave) config.devices = window.EosDeviceEms.prepareSave(config.devices, originalConfig.devices);
227
231
  delete config.devicesJson;
228
232
  status('Konfiguration wird sicher gespeichert und übernommen …');
229
- await request('', { method: 'PUT', body: JSON.stringify({ config }) });
233
+ await request('', { method: 'PUT', body: JSON.stringify({ config, expectedConfigurationRevision: configurationRevision }) });
230
234
  dirty = false;
231
235
  await reload();
232
236
  }));
@@ -20,6 +20,7 @@ const { getDeyeProfile, buildDeyeAliases } = require('./deyeProtocol');
20
20
  const { getVartaProfile, registersForProfile, buildVartaAliases } = require('./vartaProtocol');
21
21
  const { extendedRegistersForProfile, buildVartaExtendedAliases } = require('./vartaExtendedProtocol');
22
22
  const { MqttDriver } = require('./drivers/mqtt');
23
+ const { MqttCallbackQueue, assertMqttMessageSession } = require('./drivers/mqttPendingOperations');
23
24
  const { CanbusDriver } = require('./drivers/canbus');
24
25
  const { HttpDriver } = require('./drivers/http');
25
26
  const { UdpDriver } = require('./drivers/udp');
@@ -83,6 +84,7 @@ const MAX_EV_CHARGER_FRESHNESS_REFRESH_MS = 10000;
83
84
  class DeviceRuntime {
84
85
  constructor(adapter, deviceConfig, template, globalConfig) {
85
86
  this.adapter = adapter;
87
+ this._mqttCallbacks = new MqttCallbackQueue();
86
88
  this.cfg = deviceConfig;
87
89
  this.template = template;
88
90
  this.global = globalConfig || {};
@@ -674,6 +676,7 @@ class DeviceRuntime {
674
676
  }
675
677
 
676
678
  async _setStateCached(relId, val, ack = true, options = undefined) {
679
+ assertMqttMessageSession();
677
680
  if (!relId) return false;
678
681
  const key = String(relId);
679
682
  const nextAck = !!ack;
@@ -695,10 +698,14 @@ class DeviceRuntime {
695
698
  try {
696
699
  await this.adapter.setStateAsync(key, { val: nextVal, ack: nextAck });
697
700
  this._stateCache.set(key, { val: nextVal, ack: nextAck, writtenAt: now });
698
- return true;
699
701
  } catch (_) {
702
+ assertMqttMessageSession();
700
703
  return false;
701
704
  }
705
+ // The DB write already submitted cannot be recalled. Stop this old callback
706
+ // here; the queued offline barrier follows its completion and wins last.
707
+ assertMqttMessageSession();
708
+ return true;
702
709
  }
703
710
 
704
711
  _computeLiveAliasRefreshMs({ fastIntervalMs, isEventDriven } = {}) {
@@ -983,6 +990,7 @@ class DeviceRuntime {
983
990
  }
984
991
 
985
992
  async _tickHeartbeatFromIncomingData(sourceStamp) {
993
+ assertMqttMessageSession();
986
994
  // sourceStamp: optional monotonic marker that only changes when *new* data arrived
987
995
  // (e.g., Speedwire lastSeen timestamp). If provided, we only tick when it changes.
988
996
  if (!this.started) return;
@@ -6612,7 +6620,12 @@ class DeviceRuntime {
6612
6620
  try { await pending; } finally { this._qualifiedAliasPendingWrites.delete(pending); }
6613
6621
  }
6614
6622
 
6615
- async _handleMqttSnapshot(values, meta) {
6623
+ _handleMqttSnapshot(values, meta) {
6624
+ return this._mqttCallbacks.run(() => this._applyMqttSnapshot(values, meta));
6625
+ }
6626
+
6627
+ async _applyMqttSnapshot(values, meta) {
6628
+ assertMqttMessageSession();
6616
6629
  const context = meta || {};
6617
6630
  if (context.diagnosticsOnly === true) {
6618
6631
  // Metadata and error envelopes can change aliases without proving live
@@ -6638,7 +6651,11 @@ class DeviceRuntime {
6638
6651
  await this._updateAliases(values || {}, { connected, lastError }).catch(() => {});
6639
6652
  }
6640
6653
 
6641
- async _handleMqttConnectionState(connected, errorMessage) {
6654
+ _handleMqttConnectionState(connected, errorMessage) {
6655
+ return this._mqttCallbacks.run(() => this._applyMqttConnectionState(connected, errorMessage), 'barrier');
6656
+ }
6657
+
6658
+ async _applyMqttConnectionState(connected, errorMessage) {
6642
6659
  const isConnected = !!connected;
6643
6660
  if (isConnected) {
6644
6661
  await this._setStateCached(`${this.baseId}.info.connection`, true, true);
@@ -6683,7 +6700,7 @@ class DeviceRuntime {
6683
6700
  this.global,
6684
6701
  (dp) => this.relStateId(dp),
6685
6702
  (dp) => this._getRoundingDecimals(dp),
6686
- () => { this._tickHeartbeatFromIncomingData().catch(() => {}); },
6703
+ () => this._mqttCallbacks.run(() => this._tickHeartbeatFromIncomingData()),
6687
6704
  (values, meta) => this._handleMqttSnapshot(values, meta),
6688
6705
  (connected, errorMessage) => this._handleMqttConnectionState(connected, errorMessage)
6689
6706
  );
@@ -7423,6 +7440,12 @@ class DeviceRuntime {
7423
7440
  try { clearTimeout(this._aliasMetadataRefreshTimer); } catch (_) {}
7424
7441
  this._aliasMetadataRefreshTimer = null;
7425
7442
  }
7443
+ // Invalidate the MQTT session before the final offline states. A submitted
7444
+ // DB write must settle first; an unresolved drain is not a confirmed stop.
7445
+ if (this.cfg.protocol === 'mqtt') {
7446
+ if (this.driver) await this.driver.disconnect();
7447
+ await this._mqttCallbacks.drain();
7448
+ }
7426
7449
  // Mark offline on stop (fail-safe)
7427
7450
  for (const relId of this._hbRelIds('online')) {
7428
7451
  await this._setStateCached(relId, false, true);