From e6ed5536c99495a454622be05965424341c14367 Mon Sep 17 00:00:00 2001 From: archipelago Date: Thu, 30 Jul 2026 17:03:55 -0400 Subject: [PATCH] feat(02-06): cache the Server tab's seven load groups with explicit TTL/persist MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Server.vue already had five of the seven load groups (network summary, FIPS summary, VPN peers, interfaces, Tor services) on useCachedResource from a pre-phase commit, but none declared an explicit ttlMs/persist (relying on the composable's 30s/persist:true defaults) and dedup:true was missing from several underlying RPC calls. loadDiskStatus was the one remaining plain uncached fetch, forced on every activation. - Explicit TTL per group (10s fast tier: network-summary/interfaces/ disk-status; 30s near-default: vpn-peers/tor-services; 60s near-static: fips-summary) - Explicit persist:false for server.vpn-peers (npub/peer identity) and server.tor-services (onion addresses) per T-02-01; other groups persist - New server.disk-status cached resource replaces the plain fetch; it now self-heals via the composable's own onActivated instead of an explicit every-entry call - dedup:true added to all underlying rpcClient calls, including the parameterless vpnStatus()/dnsStatus()/diskStatus() convenience methods - RefreshIndicator wired into a new minimal header row, driven by whether any of the six cache entries is refreshing - RESEARCH assumption A3 settled: read all seven loader bodies; none consumes another's result — the concurrent fan-out is correct as-is - Fixed a keepAliveLifecycle.test.ts assertion invalidated by the new 10s network-summary TTL (reactivation now also revalidates that resource, adding one more vpnStatus() call the test didn't previously account for) Co-Authored-By: Claude Fable 5 --- neode-ui/src/api/rpc-client.ts | 4 +- neode-ui/src/views/Server.vue | 118 +++++-- .../views/__tests__/serverTabCache.test.ts | 293 ++++++++++++++++++ .../__tests__/keepAliveLifecycle.test.ts | 14 +- 4 files changed, 399 insertions(+), 30 deletions(-) create mode 100644 neode-ui/src/views/__tests__/serverTabCache.test.ts diff --git a/neode-ui/src/api/rpc-client.ts b/neode-ui/src/api/rpc-client.ts index ce50ee6f..fbccb4f6 100644 --- a/neode-ui/src/api/rpc-client.ts +++ b/neode-ui/src/api/rpc-client.ts @@ -1021,6 +1021,7 @@ class RPCClient { return this.call({ method: 'vpn.status', params: {}, + dedup: true, // read-only status; safe to collapse concurrent callers (PERF-02) }) } @@ -1091,6 +1092,7 @@ class RPCClient { return this.call({ method: 'network.dns-status', params: {}, + dedup: true, // read-only status; safe to collapse concurrent callers (PERF-02) }) } @@ -1118,7 +1120,7 @@ class RPCClient { used_percent: number level: 'ok' | 'warning' | 'critical' }> { - return this.call({ method: 'system.disk-status' }) + return this.call({ method: 'system.disk-status', dedup: true }) // read-only; safe to collapse concurrent callers (PERF-02) } async diskCleanup(): Promise<{ diff --git a/neode-ui/src/views/Server.vue b/neode-ui/src/views/Server.vue index 2c33651d..d225eb21 100644 --- a/neode-ui/src/views/Server.vue +++ b/neode-ui/src/views/Server.vue @@ -1,6 +1,13 @@