From 0b3cc90f4b2189892657bc0fd6539f512eee32ea Mon Sep 17 00:00:00 2001 From: ShuryaR Date: Tue, 7 Apr 2026 19:12:56 +0530 Subject: [PATCH] fix(NewSite): prevent infinite reactivity loop from in-place sort mutation Computed properties `availableVersions`, `selectedVersionApps`, and method `autoSelectVersion` call `.sort()` directly on reactive arrays which mutates them in place, triggering Vue re-evaluation of dependents and causing an infinite loop that freezes the browser. The bug is dormant with few marketplace apps but triggers when app count increases enough for sort to produce a different order. Fix: spread into a new array before sorting to avoid mutating reactive source data. --- dashboard/src/pages/NewSite.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dashboard/src/pages/NewSite.vue b/dashboard/src/pages/NewSite.vue index 4294fa202e8..3cbf58c86af 100644 --- a/dashboard/src/pages/NewSite.vue +++ b/dashboard/src/pages/NewSite.vue @@ -722,7 +722,7 @@ export default { }, availableVersions() { if (!this.apps.length || this.bench) - return (this.options?.versions || []).sort((a, b) => + return [...(this.options?.versions || [])].sort((a, b) => b.name.localeCompare(a.name), ); @@ -773,7 +773,7 @@ export default { let apps = []; if (!this.bench) - apps = (this.options?.app_source_details || []).sort((a, b) => + apps = [...(this.options?.app_source_details || [])].sort((a, b) => a.total_installs !== b.total_installs ? b.total_installs - a.total_installs : a.app.localeCompare(b.app), @@ -1015,7 +1015,7 @@ export default { autoSelectVersion() { if (!this.availableVersions) return null; - return this.availableVersions + return [...this.availableVersions] .sort((a, b) => b.name.localeCompare(a.name)) .find((v) => !v.disabled)?.name; },