When in the upgrade process the version in the config is still the old
version. (Since we only upgrade it after the upgrade is complete).
However the app list fetched from the appstore must be the new list.
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
* If the ETag if present store it
* If a stored ETag is present then pass it along (with the original
response) to get
* Add tests
* Added files to classmap
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
As SemVer can be used apps could define a release like "10.0.0-alpha". This is something that we don't support at the moment in the server and we should filter all prereleases.
Ref https://github.com/nextcloud/server/pull/2307#issuecomment-262911588
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
The current implementation when fetching apps from the appstore is to assume that the first element is the newest version, this is now always applicable and leads to the fact that for some apps (e.g. nextant) the newest version is not delivered. This can be easily tested by comparing the version of the downloaded Nextant version.
This change will loop over all releases delivered by the appstore and chooses the newest compatible one. While not the cleanest solution, it does its job.
Most of the code are actually unit tests. Whereas I have copied the whole original response from the appstore and also have performed the transformation. So that's why the diff looks so huge.
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>