From bffa5b28bd5f19334a3e93ddfae3f990673afc22 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Mon, 29 Jun 2026 19:05:50 -0400 Subject: [PATCH] fix(diagnostics): StateFlow distinctUntilChanged build error + AdminUser test fixtures - DiagnosticsReporter.collectServerHealth: drop distinctUntilChanged() on networkStatus.state (StateFlow is already distinct; the deprecation warning is a hard error under allWarningsAsErrors). - web users.test.ts: add debug_mode_enabled to the alice/bob AdminUser fixtures now that the field is required on the type. Co-Authored-By: Claude Opus 4.8 (1M context) Claude-Session: https://claude.ai/code/session_01K55iTxn95BtshocgdE1shW --- .../fabledsword/minstrel/diagnostics/DiagnosticsReporter.kt | 4 +++- web/src/routes/admin/users/users.test.ts | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/android/app/src/main/java/com/fabledsword/minstrel/diagnostics/DiagnosticsReporter.kt b/android/app/src/main/java/com/fabledsword/minstrel/diagnostics/DiagnosticsReporter.kt index bb743ff7..fe827015 100644 --- a/android/app/src/main/java/com/fabledsword/minstrel/diagnostics/DiagnosticsReporter.kt +++ b/android/app/src/main/java/com/fabledsword/minstrel/diagnostics/DiagnosticsReporter.kt @@ -127,7 +127,9 @@ class DiagnosticsReporter @Inject constructor( } private suspend fun collectServerHealth() { - networkStatus.state.distinctUntilChanged().collect { s -> + // state is a StateFlow — already conflated/distinct, so no + // distinctUntilChanged (it's a deprecation warning = build error). + networkStatus.state.collect { s -> record("connectivity", buildJsonObject { put("event", "server_health") put("state", s.name) diff --git a/web/src/routes/admin/users/users.test.ts b/web/src/routes/admin/users/users.test.ts index 08b641b0..8869a2d7 100644 --- a/web/src/routes/admin/users/users.test.ts +++ b/web/src/routes/admin/users/users.test.ts @@ -38,6 +38,7 @@ const alice: AdminUser = { display_name: null, is_admin: true, auto_approve_requests: false, + debug_mode_enabled: false, created_at: '2026-05-01T00:00:00Z' }; @@ -47,6 +48,7 @@ const bob: AdminUser = { display_name: 'Bob B', is_admin: false, auto_approve_requests: false, + debug_mode_enabled: false, created_at: '2026-05-02T00:00:00Z' };