iNavFlight / inav-configurator

GNU General Public License v3.0
565 stars 304 forks source link

Get latest release instead of list of all releases in version checker #2124

Closed bfmvsa closed 1 week ago

bfmvsa commented 1 week ago

It is possible to retrieve the desired release directly instead of the approach when you get a whole list of releases and then get the latest one from the sorted list.

Currently, the number of releases retrieved from /repos/iNavFlight/inav-configurator/releases equals to 29. That's approximately 600KB of data retrieved every check in json. After this update the size of loaded json through /repos/iNavFlight/inav-configurator/releases/latest is about 24KB

bfmvsa commented 1 week ago

Sorry guys for the random pull requests, but I'm starting to research the repo and as a side effect trying to be useful if it is possible. In this specific PR I figured out that we don't need to retrieve all list of inav releases to check if current version is outdated. After this fix we will save to inav users about half of megabyte every check.

mmosca commented 1 week ago

I am not sure this particular one is a good idea. Sometimes INAV has bugs, or someone wants to check if an issues happened on an older release. Fetching only the latest release, while faster, does not allow for these use cases. It also breaks showing pre-release versions.

Edit:

Oh wait... that is the version checker... :)

Thay should be ok. We just need to remember to mark the release as latest.

bfmvsa commented 1 week ago

Yes I agree, the title of the pr without checking the changed files is unclear. Changed a little bit the title.