Skip to content

fix(receiver-ui): show stream metrics on initial load#189

Merged
iwismer merged 4 commits intomasterfrom
iwismer/fix-receiver-initial-metrics
Mar 23, 2026
Merged

fix(receiver-ui): show stream metrics on initial load#189
iwismer merged 4 commits intomasterfrom
iwismer/fix-receiver-initial-metrics

Conversation

@iwismer
Copy link
Copy Markdown
Owner

@iwismer iwismer commented Mar 23, 2026

Summary

  • Stream metrics showed "Metrics unavailable" when first opening the receiver until unsubscribing and resubscribing
  • Root cause: initial metrics sent during the WS handshake were lost because the Svelte event listeners weren't registered yet
  • Fix: cache stream metrics in the receiver backend (AppState) and expose them via a new get_stream_metrics Tauri command, fetched during loadAll() alongside other startup data
  • Cache is cleared on disconnect to stay consistent with the frontend

Test plan

  • Open receiver with an active server connection — stream details should show metrics immediately without needing to unsubscribe/resubscribe
  • Verify metrics update in real-time as new reads arrive
  • Disconnect and reconnect — metrics should repopulate on reconnect
  • All existing receiver tests pass (cargo test -p receiver)

🤖 Generated with Claude Code

iwismer and others added 4 commits March 22, 2026 21:49
Cache stream metrics in the receiver backend so the frontend can fetch
them via a new get_stream_metrics Tauri command during loadAll(). This
fixes the race where initial metrics from the server WS handshake were
lost because the Svelte event listeners weren't registered yet.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The getStreamMetrics export was missing from $lib/api mocks, causing
6 test failures across 3 test files after the initial metrics feature.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…rors

Add test coverage for stream metrics caching in handshake and session
loop, verify frontend store merges cached metrics on load, and log
getStreamMetrics failures instead of silently swallowing them.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@iwismer iwismer merged commit 422d674 into master Mar 23, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant