question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hacs tries to downgrade component to beta version

See original GitHub issue

System Health details

System Health

version core-2021.9.7
installation_type Home Assistant Container
dev false
hassio false
docker true
user root
virtualenv false
python_version 3.9.7
os_name Linux
os_version 5.4.0-88-generic
arch x86_64
timezone Europe/Rome
Home Assistant Community Store
GitHub API ok
Github API Calls Remaining 4747
Installed Version 1.15.2
Stage running
Available Repositories 882
Installed Repositories 16
Lovelace
dashboards 6
resources 10
views 16
mode storage

Checklist

  • I’m running the newest version of HACS https://github.com/hacs/integration/releases/latest
  • I have enabled debug logging for my installation.
  • I have filled out the issue template to the best of my ability.
  • I have read https://hacs.xyz/docs/issues
  • This issue is related to the backend (integration part) of HACS.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).

Describe the issue

Hacs informs the user about an update, but in fact it’s a downgrade as you can see in the screenshot. grafik

I started my investigation at the manifest of both version, but they are set correctly. Also the tags are set correctly so it must be a bug in hacs.

During my investigation in the hacs code base (sorry I’m not familiar with the code) I found out, that the function custom_components.hacs.helpers.functions.information.get_releases is getting the releases via aiogithubapi. The returned list from aiogithubapi.objects.repository.AIOGitHubAPIRepository.get_releases is not sorted correctly by semantic versioning. On the specific example of “Deebot-for-Home-Assistant” the returned list included the version in the following order:

  • 3.1.4b3
  • 3.1.4b2
  • 3.2.0
  • 3.1.4b1

I think this is the problem as hacs probably checks only the first entry and shows an update notification if the version don’t match. Please correct me if I’m wrong but this is my assumption and I didn’t checked it. (My not familiar with the code and it takes some time to find the correct information)

I had to release a quick bug fix so the update window is showing now the correct version, but if you open the “reinstall” dialog, you can still see that the version are ordered wrong. grafik

Reproduction steps

  1. Open the install dialog of the integration “Deebot for Home Assistant” and toggle “Show beta versions” 1a. If you have already selected or installed the integration please click on “Update Information” to fetch the latest information
  2. As you can in the screenshot above the releases are sorted in the wrong order

For Devs:

  1. Create a breakpoint in config.custom_components.hacs.helpers.functions.information.get_releases on Line 79
  2. Click again on “Update Informations”
  3. When the debugger stops at the break point, modify the releases variable by sorting the versions correctly [releases[0], releases[3], releases[1], releases[2], releases[4]]
  4. Reopen the “reinstall” dialog and you can see that the versions are sorted correctly

Debug logs

2021-10-06 14:41:58 DEBUG (MainThread) [custom_components.hacs] Running update for And3rsL/Deebot-for-Home-Assistant
2021-10-06 14:41:58 DEBUG (MainThread) [custom_components.hacs] <Integration And3rsL/Deebot-for-Home-Assistant> Getting repository information
2021-10-06 14:41:59 DEBUG (MainThread) [custom_components.hacs] <Integration And3rsL/Deebot-for-Home-Assistant> Running checks against 3.2.1
2021-10-06 14:42:00 DEBUG (MainThread) [custom_components.hacs] 'states' is undefined
2021-10-06 14:42:00 DEBUG (MainThread) [custom_components.hacs] Saving data

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
edenhauscommented, Oct 6, 2021

Thanks for your help 😊 Than I will follow your release cycle on hacs and only release version on master without betas 😊

As always thanks for all your work here and on HA and a nice release party tonight 😂

0reactions
ludeeuscommented, Oct 6, 2021

Until GitHub adds a sort param to https://docs.github.com/en/rest/reference/repos#list-releases I don’t see that happening. You most likely got in this situation because your releases target 2 different branches. master and the now-deleted refactor-events, it uses the time from the last commit in the target branch to determine the order.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Update notification actually tries to downgrade the ... - GitHub
I've just made a fresh install of the HACS and it immediately shows that there is a pending system update. Upon opening the...
Read more >
Enable beta for a repository - HACS
First you need to have the repository already downloaded and managed by HACS. Once that is in place, click on the card for...
Read more >
2022.11: A heck of a release! - Home Assistant
Home Assistant will try to auto-detect the correct day to start the week based on information provided by your browser. However, if it...
Read more >
How To Downgrade iOS 16 Beta/15 Without Losing Data
At first, you should back up your data, then you can tap the “Repair” button. If you want to downgrade the iOS 16...
Read more >
Urgent firmware downgrade request (2.0.6_0051) Home ...
Side question: why not publishing your library in HACS? ... Try to enable logs for the yeelight components and check your logs
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found