feat: add export-logs-as-file option to startup error screen - #2490
Conversation
|
@claude review |
|
Claude finished @ethicnology's task in 2m 32s —— View job PR Review: export-logs-as-file on startup error screen
Overall this is a clean, well-scoped change and the core logic is correct — mounted checks are placed properly around the async gaps, errors are caught and surfaced with localized messages, and I verified all four loc keys ( 1. Shared log files are written to the temp dir and never deleted
final file = File(path);
await file.writeAsString(logs.join('\n'));
try {
await SharePlus.instance.share(
ShareParams(files: [XFile(path)], subject: 'bull_logs.tsv'),
);
} finally {
await file.delete();
}(One caveat: on some Android targets the receiving app reads the file after the sheet returns, so if you've seen that bite before, an alternative is a fixed filename so at most one stale copy ever exists.) Fix this → 2. The PR changes more behavior than the description statesThe description says this only adds an export button to the startup error screen, but
Both are defensible (file attachments avoid Android intent size limits on large logs), but note that 3. Minor: share subject doesn't match the attached filename
Notes
|
Summary
Adds a "download logs as a file" (export) button to the app startup error screen, alongside the existing "share logs" button — lets a user stuck on the startup error screen save their logs to a file (via the OS file picker) instead of only being able to share them.
This is extracted from #2438 and #2440 (both still open, larger PIN-error-handling and LWK-concurrent-wollet-access work) so this standalone log-export improvement can ship independently without waiting on that larger work. It does not touch any PIN/keychain/LWK logic.
Files changed (3)
lib/core/screens/app_init_error_screen.dartlib/core/widgets/share_logs_bottom_sheet.dartlib/core/widgets/share_logs_widget.dartNo new localization strings are needed — all loc keys used (
logsExportedMessage,logsExportFailedMessage,logsShareOptionExport,errorSharingLogsMessage) already exist onmain, added by an earlier merged PR (#2317).Test plan
fvm dart analyzeclean on the 3 changed filesfvm dart formatclean on the 3 changed filestest/)🤖 Generated with Claude Code