ioBroker / ioBroker.admin

user interface for configuration and administration
https://iobroker.net
MIT License
273 stars 78 forks source link

[admin 5] message handling during upgrade does not work as expected #1605

Closed mcm1957 closed 2 years ago

mcm1957 commented 2 years ago

Describe the bug
Admin provides a message handling during upgrade of an adapter which can be configured to show messages when upgrading from a version lower than xxx to a version higher than yyy.

During upgrading an adapter the first message is always shown regardless of any match. If two messages match the criteria, the are not shown both.

Example 1:

Upgrading from 2.0.0 to 2.0.1 I would expect that NO Message is shown but message releted to pre 1.0.0 to 1.0.0 Upgrade is shown Please see picture series

![iob-messages-s1-1](https://user-images.githubusercontent.com/28575778/180606362-a60d6a42-87e5-47b0-bab7-7c51af2a8838.jpg iob-messages-s1-2 iob-messages-s1-3

Example 2:

Upgrading from 1.0.0 to 2.0.1 I would expect that only 2.0.0 message is shown but message related to pre 1.0.0 to 1.0.0 upgrade is shown; message related to 2.0.0 upgrade is NOT shown

Please see picture series iob-messages-s2-1 iob-messages-s2-2a iob-messages-s2-2b iob-messages-s2-3

Expected behavior
I would expect to see all messages which criteria are met but no others

Versions:

Additional context
Link to adapter repo: https://github.com/iobroker-community-adapters/ioBroker.snmp io-package.json - message section: https://github.com/iobroker-community-adapters/ioBroker.snmp/blob/cca8dc45ccf576c5758059625627d17bed7ce73f/io-package.json#L122

clear text of message section:

    "messages": [
      {
        "condition": {
          "operand": "and",
          "rules": [
            "oldVersion<2.0.0",
            "newVersion>=2.0.0"
          ]
        },
        "title": {
          "en": "Important notice!",
          "de": "Wichtiger Hinweis!",
          "ru": "Важное замечание!",
          "pt": "Notícia importante!",
          "nl": "Belangrijke mededeling!",
          "fr": "Avis important!",
          "it": "Avviso IMPORTANTE!",
          "es": "Noticia importante!",
          "pl": "Ważna uwaga!",
          "zh-cn": "重要通知!"
        },
        "text": {
          "en": "Configuration data has been changed for version 2.0.0 (and newer). Installation will try to migrate data but there is a chance that this fails. Please ensure that you have a backup and a external documention of your configuration before upgrading to version 2.0.0 or newer.",
          "de": "Konfigurationsdaten wurden für Version 2.0.0 (und neuer) geändert. Die Installation wird versuchen, Daten zu migrieren, aber es gibt eine Chance, dass dies versagt. Bitte stellen Sie sicher, dass Sie ein Backup und eine externe Dokumentation Ihrer Konfiguration vor dem Upgrade auf Version 2.0.0 oder neuer haben.",
          "ru": "Данные конфигурации были изменены для версии 2.0.0 (и новее). Установка будет пытаться перенести данные, но есть шанс, что это не работает. Пожалуйста, убедитесь, что у вас есть резервное копирование и внешний документирование вашей конфигурации перед обновлением до версии 2.0.0 или новее.",
          "pt": "Os dados de configuração foram alterados para a versão 2.0.0 (e mais recente). A instalação tentará migrar dados, mas há uma chance de que isso falha. Certifique-se de ter um backup e uma documentação externa de sua configuração antes de atualizar para a versão 2.0.0 ou mais recente.",
          "nl": "Vermoedende data is veranderd voor versie 2.0. Installatie zal proberen data te verminderen maar er is een kans dat dit mislukt. Zorg ervoor dat je een back-up hebt en een externe documentie van je zelfvertrouwen voordat je verstoort naar versie 2.0 of nieuwer.",
          "fr": "Les données de configuration ont été modifiées pour la version 2.0.0 (et plus récente). L'installation tentera de migrer les données, mais il y a une chance que cela échoue. Assurez-vous d'avoir une sauvegarde et une documentation externe de votre configuration avant de passer à la version 2.0.0 ou plus récente.",
          "it": "I dati di configurazione sono stati modificati per la versione 2.0.0 (e più recente). L'installazione cercherà di migrare i dati, ma c'è la possibilità che questo fallisca. Si prega di assicurarsi di avere un backup e un documento esterno della configurazione prima di aggiornare alla versione 2.0.0 o più recente.",
          "es": "Los datos de configuración se han modificado para la versión 2.0.0 (y más reciente). La instalación intentará migrar datos pero hay una posibilidad de que esto falle. Por favor, asegúrese de tener una copia de seguridad y una documentación externa de su configuración antes de actualizar a la versión 2.0.0 o más reciente.",
          "pl": "Dane konfiguracyjne zostały zmienione na wersję 2.0.0 (i nowszą). Instalacja stara się wyemitować dane, ale istnieje szansa, że to się nie udaje. Zapewniajcie, że mamy backup i zewnętrzną dokumentację twojej wersji 2.0.0 lub nowszego.",
          "zh-cn": "对2.0.0版本(和新版)的合并数据进行了修改。 绝大部分将试图迁移数据,但有失败的机会。 请确保在更新至2.0.0或新版之前,对你的配置进行反馈和外部记录。."
        },
        "link": "https://github.com/iobroker-community-adapters/ioBroker.snmp#changelog",
        "level": "warn",
        "linkText": {
          "en": "Changelog",
          "de": "Änderungsprotokoll",
          "ru": "Список изменений",
          "pt": "Registro de alterações",
          "nl": "Wijzigingslog",
          "fr": "Journal des modifications",
          "it": "Registro delle modifiche",
          "es": "registro de cambios",
          "pl": "Dziennik zmian",
          "zh-cn": "变更日志"
        },
        "buttons": [
          "agree",
          "cancel"
        ]
      },
      {
        "condition": {
          "operand": "and",
          "rules": [
            "oldVersion<1.0.0",
            "newVersion>=1.0.0"
          ]
        },
        "title": {
          "en": "Important notice!",
          "de": "Wichtiger Hinweis!",
          "ru": "Важное замечание!",
          "pt": "Notícia importante!",
          "nl": "Belangrijke mededeling!",
          "fr": "Avis important!",
          "it": "Avviso IMPORTANTE!",
          "es": "Noticia importante!",
          "pl": "Ważna uwaga!",
          "zh-cn": "重要通知!"
        },
        "text": {
          "en": "Version 1.0.0 will change the names of objects containing special characters like \\\".\\\", \\\"-\\\" or spaces! Please delete the old objects manually if needed.",
          "de": "Version 1.0.0 ändert die Namen von Objekten, die spezielle Zeichen wie \\\"\\\", \\\"-\\\" oder Leerzeichen enthalten! Bitte löschen Sie die alten Objekte bei Bedarf manuell.",
          "ru": "Версия 1.0.0 изменит имена объектов, содержащих специальные символы, такие как \\\".\\\", \\\"-\\\" или пространства! Пожалуйста, удалите старые объекты вручную, если это необходимо.",
          "pt": "A versão 1.0.0 mudará os nomes de objetos contendo caracteres especiais como \\\".\\\", \\\"-\\\" ou espaços! Por favor, exclua os objetos antigos manualmente, se necessário.",
          "nl": "Version 1.0.0 zal de namen veranderen van objecten met speciale personages zoals . Verwijder de oude objecten handmatig als het nodig is.",
          "fr": "La version 1.0.0 va changer les noms des objets contenant des caractères spéciaux comme \\\".\\\", \\\"-\\\" ou des espaces! Veuillez supprimer les anciens objets manuellement si nécessaire.",
          "it": "La versione 1.0.0 cambierà i nomi di oggetti contenenti caratteri speciali come \\\", \\\"-\\\" o spazi! Si prega di eliminare i vecchi oggetti manualmente se necessario.",
          "es": "Versión 1.0.0 cambiará los nombres de objetos que contienen caracteres especiales como \\\".\\\", \\\"-\\\" o espacios! Por favor, borre los viejos objetos manualmente si es necesario.",
          "pl": "Wersja 1.0.0 zmienia nazwę obiektów o specjalnych postaciach, takich jak: \\, \\ lub przestrzeni! Okazuje się, że stare obiekty ręcznie będą potrzebne.",
          "zh-cn": "Version1.0.0将改变含有特殊特性的物体的名称,如乙型号、乙型号或空间。 请在必要时删除旧物体。."
        },
        "link": "https://github.com/iobroker-community-adapters/ioBroker.snmp#changelog",
        "level": "warn",
        "linkText": {
          "en": "Changelog",
          "de": "Änderungsprotokoll",
          "ru": "Список изменений",
          "pt": "Registro de alterações",
          "nl": "Wijzigingslog",
          "fr": "Journal des modifications",
          "it": "Registro delle modifiche",
          "es": "registro de cambios",
          "pl": "Dziennik zmian",
          "zh-cn": "变更日志"
        },
        "buttons": [
          "agree",
          "cancel"
        ]
      }
    ]
  },
Feuer-sturm commented 2 years ago

@mcm1957 do you have the possibility to check this with current beta version of admin 6?

mcm1957 commented 2 years ago

Sorry for the late reply. Soemhow notifications do not work as expected. I will install admin 6 at my test system an check this out

Feuer-sturm commented 2 years ago

@mcm1957 Thanks.

mcm1957 commented 2 years ago

I've installed Admin 6.2.4 (lastes repo). The problem does NOT occure at the current lastest / beta.

I've tested: 2.0.0 -> 2.0.1 installation via admin no confirm just as expected

1.0.0 -> 2.0.1 installation via admin only the 2.0.0 confirmation box as expected

Please feel free to close the issue unless you plan to make a backport for admion 5.x.x