Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve marketplace add-on handling #4019

Merged
merged 1 commit into from
Jan 14, 2024
Merged

Improve marketplace add-on handling #4019

merged 1 commit into from
Jan 14, 2024

Commits on Jan 5, 2024

  1. Improve marketplace add-on handling

    It has been reported several times that add-ons were not properly installed / missing after an upgrade or the installation of incompatible add-ons resulted in broken installations.
    
    After an upgrade (or clean cache) the `AddonHandler`s try to re-install the add-ons from the download cache (`<userdata>/marketplace`). This happens without checking compatibility. This was needed before OH4, because the cache was the only source providing information about installed add-ons. This is now different, since we store the add-on information in a JSON database, so the UIDs of the add-ons are known.
    
    This PR changes improves the add-on services. It now
    
    1. Reads the information about the installed add-ons from the database and sets the installation status based on information from the handlers.
    2. Removes all add-ons that are not installed from the JSON database and remembers their UIDs.
    3. Refreshes the remote add-on list (including check for compatibility if not disabled).
    4. Tries installation of the add-ons remembered in step 2. Since incompatible add-ons are missing in the add-on list, their installation fails and a warning is logged.
    
    This PR is has two corresponding PR in openhab-distro and openhab-linuxpkg to ensure that the upgrade script and `openhab-cli` also clear the marketplace cache.
    
    Signed-off-by: Jan N. Klug <github@klug.nrw>
    J-N-K committed Jan 5, 2024
    Configuration menu
    Copy the full SHA
    4efb809 View commit details
    Browse the repository at this point in the history