iuna

iuna

iuna - experimental devnet protocol
git clone https://getiuna.org/git/iuna.git
Log | Files | Refs | README | LICENSE

commit 7a6ffd44a463cc3313cd539bc28a9c782642fc46
parent 92f1507e3ee5cbbed1e47ec72738191c073e4f69
Author: Joris Hartog <jorishartog@hotmail.com>
Date:   Thu, 13 Aug 2026 09:22:59 +0200

Fix version update badge comparison

Diffstat:
Msrc/adapters/http/tests.rs | 21+++++++++++++++++++++
Mwww/assets/iuna-ui.js | 5+++--
2 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/src/adapters/http/tests.rs b/src/adapters/http/tests.rs @@ -1495,6 +1495,27 @@ fn metrics_screen_includes_block_range_filter() { } #[test] +fn version_update_check_normalizes_tags_before_comparing() { + let app_js = include_str!("../../../www/assets/iuna-ui.js"); + let update_available = app_js + .split("updateAvailable()") + .nth(1) + .expect("updateAvailable should exist") + .split("versionPanelTitle()") + .next() + .expect("updateAvailable should precede versionPanelTitle"); + + assert!( + update_available + .contains("const current = this.normalizeVersion(this.status.app_version);") + ); + assert!( + update_available.contains("const latest = this.normalizeVersion(this.latestRelease?.tag);") + ); + assert!(update_available.contains("if (current === latest) return false;")); +} + +#[test] fn blocks_endpoint_uses_cached_block_projection_without_cloning_full_ui_index() { let api_rs = include_str!("api.rs"); assert!(api_rs.contains("cached_ui_blocks_for_tip(&state, Some(tip_hash.as_str()), blocks)")); diff --git a/www/assets/iuna-ui.js b/www/assets/iuna-ui.js @@ -237,9 +237,10 @@ window.iunaApp = function iunaApp() { }, updateAvailable() { - const current = this.status.app_version; - const latest = this.latestRelease?.tag; + const current = this.normalizeVersion(this.status.app_version); + const latest = this.normalizeVersion(this.latestRelease?.tag); if (!current || !latest) return false; + if (current === latest) return false; return this.compareVersions(latest, current) > 0; },