From 31bdfb948938285ffc6c6455bf83f350f8b7b4f6 Mon Sep 17 00:00:00 2001 From: diffwireauto <330573775+diffwireauto@users.noreply.github.com> Date: Mon, 19 Oct 2026 03:54:33 -0400 Subject: [PATCH] feat(#910): ship ANR traces with the exported log shareLogs() exported exactly one file, the active offband.log, and the rotated .1.log and .2.log were never exported at all. So a trace written anywhere other than inline would never have reached anyone, and a trace written inline would later rotate out of the only file that ships. SharePlus already takes a list of files, so this attaches the trace files beside the log with no new UI and no new localized strings. Mobile only: the records are Android-only and the desktop path saves a single chosen file. Without this the Epic would ship and deliver nothing, which is why it is part of the build rather than a follow-up. Co-Authored-By: Claude Opus 5 --- lib/utils/log_export.dart | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/lib/utils/log_export.dart b/lib/utils/log_export.dart index 2532cf4e..e37e7d5b 100644 --- a/lib/utils/log_export.dart +++ b/lib/utils/log_export.dart @@ -6,6 +6,7 @@ import 'package:flutter/material.dart'; import 'package:share_plus/share_plus.dart'; import '../l10n/l10n.dart'; +import '../services/app_exit_info_service.dart'; import '../services/file_log_service.dart'; import 'log_web_download.dart'; @@ -67,6 +68,12 @@ class LogExport { final messenger = ScaffoldMessenger.of(context); final l10n = context.l10n; final file = await FileLogService.instance.flushAndGetActiveFile(); + // ANR traces live beside the log rather than inside it, so they have to be + // attached explicitly or they never reach anyone (#906). Mobile only: the + // records are Android-only, and the desktop path saves a single file. + final extras = _isMobile + ? await AppExitInfoService.traceFiles() + : const []; await _exportFile( messenger, file: file, @@ -74,6 +81,7 @@ class LogExport { subject: l10n.debugLog_shareSubject, unavailableMessage: l10n.debugLog_logUnavailable, savedMessage: l10n.debugLog_logSaved, + extraFiles: extras, ); } @@ -104,6 +112,7 @@ class LogExport { required String subject, required String unavailableMessage, required String savedMessage, + List extraFiles = const [], }) async { if (file == null) { messenger.showSnackBar(SnackBar(content: Text(unavailableMessage))); @@ -111,7 +120,13 @@ class LogExport { } if (_isMobile) { await SharePlus.instance.share( - ShareParams(subject: subject, files: [XFile(file.path)]), + ShareParams( + subject: subject, + files: [ + XFile(file.path), + for (final extra in extraFiles) XFile(extra.path), + ], + ), ); return; }