Repository: nextcloud/appstore

Issue:
App details are not updated to the latest upload if only pre-releases or nightlies exist
Hi, 

I've put a new app on the nextcloud app repo, with what seems to be a correct info.xml, but it doesn't take description categories and screenshot into account, 

see there

https://apps.nextcloud.com/apps/carnet

Any ideas why ? Thanks !
App details are not updated to the latest upload if only pre-releases or nightlies exist
Hi, 

I've put a new app on the nextcloud app repo, with what seems to be a correct info.xml, but it doesn't take description categories and screenshot into account, 

see there

https://apps.nextcloud.com/apps/carnet

Any ideas why ? Thanks !


Discussion:
Because there's no stable release. Pre-releases don't set any content to avoid overriding the current stable page.

See https://github.com/nextcloud/appstore/blob/master/nextcloudappstore/api/v1/release/importer.py#L268

Probably 

    if len(releases) == 0:

should be adjusted to filter out unstable releases so if no stable release is present, unstable releases will always update the current page.
Do you think you can take on the issue and send a pull request?
Oh eeerr yes why not but I don't have the project, I can do it if you want but I don't feel like I've fixed the bug... since you did :P 
(the main issue is that I have no ways to test it)
See https://nextcloudappstore.readthedocs.io/en/latest/devinstall.html

Will probably take a few months until I have some spare time. Releasing a stable release should fix your issue so I don't think it's very dramatic.
Thanks ! I've just posted a release
Any news here? :grin: 
Suuuure ... the news is that there's no news until you bribe someone to do it @skjnldsv :P
Because there's no stable release. Pre-releases don't set any content to avoid overriding the current stable page.

See https://github.com/nextcloud/appstore/blob/master/nextcloudappstore/api/v1/release/importer.py#L268

Probably 

    if len(releases) == 0:

should be adjusted to filter out unstable releases so if no stable release is present, unstable releases will always update the current page.
Do you think you can take on the issue and send a pull request?
Oh eeerr yes why not but I don't have the project, I can do it if you want but I don't feel like I've fixed the bug... since you did :P 
(the main issue is that I have no ways to test it)
See https://nextcloudappstore.readthedocs.io/en/latest/devinstall.html

Will probably take a few months until I have some spare time. Releasing a stable release should fix your issue so I don't think it's very dramatic.
Thanks ! I've just posted a release
Any news here? :grin: 
Suuuure ... the news is that there's no news until you bribe someone to do it @skjnldsv :P

Resolving patch:
diff --git a/nextcloudappstore/api/v1/release/importer.py b/nextcloudappstore/api/v1/release/importer.py
--- a/nextcloudappstore/api/v1/release/importer.py
+++ b/nextcloudappstore/api/v1/release/importer.py
@@ -273,6 +273,16 @@ def _should_update_everything(self, value: Any) -> bool:
         if len(releases) == 0:
             return True
 
+        # if the app has no stable releases update everything
+        has_stable_release = False
+        for release in releases:
+            if '-' not in release.version and not release.is_nightly:
+                has_stable_release = True
+                break
+
+        if not has_stable_release:
+            return True
+
         current_version = value['release']['version']
 
         # we do not care about nightlies here so it's fine to just use a
@@ -282,10 +292,14 @@ def _should_update_everything(self, value: Any) -> bool:
         is_nightly = value['release']['is_nightly']
         is_stable = not is_prerelease and not is_nightly
 
+        # let's go out quickly
+        if not is_stable:
+            return False
+
         def is_newer_version(release: Any) -> bool:
             return uploaded_version >= Version(release.version)
 
         # the main page should only be updated when stable and new releases
         # are uploaded
         is_latest_version = any_match(is_newer_version, releases)
-        return is_latest_version and is_stable
+        return is_latest_version


Test patch: