fix: use semver comparison for extension version upgrades
Previously the system used simple string inequality to detect available updates, causing downgrades to appear as upgrades (e.g. 2.5.1 → 2.5.0). Now both backend (SQL) and frontend (JS) compare version tuples properly. Also fixes latest_version in DB on registry sync startup. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -456,7 +456,8 @@ function CustomerDetail({ customerId, onDelete }) {
|
||||
<tbody className="divide-y divide-slate-50">
|
||||
{sorted.map(e => {
|
||||
const installed = e.installed_version
|
||||
const hasUpdate = installed && e.latest_version && installed !== e.latest_version
|
||||
const semverGt = (a, b) => { const pa = a.split('.').map(Number), pb = b.split('.').map(Number); for (let i = 0; i < Math.max(pa.length, pb.length); i++) { if ((pa[i]||0) > (pb[i]||0)) return true; if ((pa[i]||0) < (pb[i]||0)) return false; } return false }
|
||||
const hasUpdate = installed && e.latest_version && semverGt(e.latest_version, installed)
|
||||
const missingDeps = (deps[e.name] || []).filter(d => !installedNames.has(d))
|
||||
const blocked = !installed && missingDeps.length > 0
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user