luci-app-attendedsysupgrade: sort latest version array
authorEric Fahlgren <ericfahlgren@gmail.com>
Thu, 23 Jan 2025 23:15:23 +0000 (15:15 -0800)
committerHannu Nyman <hannu.nyman@iki.fi>
Fri, 24 Jan 2025 05:10:00 +0000 (07:10 +0200)
The Attended Sysupgrade app requires that the array of latest
versions be in order from newest release to oldest.  Ensure that
this is true even when upstream presents them in arbitrary order.

Signed-off-by: Eric Fahlgren <ericfahlgren@gmail.com>
applications/luci-app-attendedsysupgrade/htdocs/luci-static/resources/view/attendedsysupgrade/overview.js

index b97416f2b784bcd8f7cad50bbb218d7bb756f321..32698b3d028fa887a207c8c373ed8c47da99e5b8 100644 (file)
@@ -450,6 +450,9 @@ return view.extend({
                        } else {
                                const latest = response.json().latest;
 
+                               // ensure order: newest to oldest release
+                               latest.sort().reverse();
+
                                for (let remote_version of latest) {
                                        let remote_branch = get_branch(remote_version);