fix(diag): record bridge and audio interruption diagnostics (#18)
* fix(diag): record bridge events in diagnostics page Connection lost/reconnecting/disconnected and iOS audio interruption events now appear in the diagnostics dialog alongside existing error snackbar entries. * fix(diag): reduce audio callback sample verbosity to debug The render callback diagnostic sample logged every 100 callbacks (~2s) at INFO level, flooding the 256-entry release log buffer and pushing out useful events. Changed to DEBUG so it only appears in debug builds with the larger 4096-entry buffer. * fix(diag): add timestamps to Rust diagnostic log entries
This commit is contained in:
@@ -624,6 +624,7 @@ class _BetaHomeState extends State<_BetaHome> with WidgetsBindingObserver {
|
||||
});
|
||||
unawaited(_refreshSnapshot(recordActivity: false, reportErrors: true));
|
||||
case rust.BridgeEvent_Lost(:final reason):
|
||||
_recordUiDiagnostic('connection', 'lost: $reason');
|
||||
setState(() {
|
||||
_phase = ConnectionPhase.reconnecting;
|
||||
_lostReason = reason;
|
||||
@@ -631,12 +632,14 @@ class _BetaHomeState extends State<_BetaHome> with WidgetsBindingObserver {
|
||||
_reconnectDelay = null;
|
||||
});
|
||||
case rust.BridgeEvent_Reconnecting(:final attempt, :final delaySecs):
|
||||
_recordUiDiagnostic('connection', 'reconnecting attempt=$attempt delay=${delaySecs}s');
|
||||
setState(() {
|
||||
_phase = ConnectionPhase.reconnecting;
|
||||
_reconnectAttempt = attempt;
|
||||
_reconnectDelay = delaySecs;
|
||||
});
|
||||
case rust.BridgeEvent_Disconnected():
|
||||
_recordUiDiagnostic('connection', 'disconnected');
|
||||
setState(() {
|
||||
_resetConnectionUiState(phase: ConnectionPhase.disconnected);
|
||||
});
|
||||
@@ -708,6 +711,7 @@ class _BetaHomeState extends State<_BetaHome> with WidgetsBindingObserver {
|
||||
if (!mounted) return;
|
||||
final messenger = ScaffoldMessenger.of(context);
|
||||
if (began) {
|
||||
_recordUiDiagnostic('audio', 'interruption began');
|
||||
messenger.showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(AppL10n.of(context).iosAudioInterrupted),
|
||||
@@ -716,6 +720,7 @@ class _BetaHomeState extends State<_BetaHome> with WidgetsBindingObserver {
|
||||
),
|
||||
);
|
||||
} else if (shouldResume) {
|
||||
_recordUiDiagnostic('audio', 'interruption ended, resuming');
|
||||
messenger.showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(AppL10n.of(context).iosAudioResuming),
|
||||
|
||||
Reference in New Issue
Block a user