Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/core/diagnostics/debug_dump.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ library;
/// a chat window will show without collapsing. The diagnostics are the part
/// that cannot be trimmed (every row answers a question somebody asks), so the
/// log takes whatever is left.
const int dumpLimit = 4000;
const int dumpLimit = 39995;

const String _diagnosticsHeading = '=== 除錯資訊 ===';
const String _logHeading = '=== 日誌紀錄 ===';
Expand Down
5 changes: 3 additions & 2 deletions lib/core/diagnostics/haste_api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ import 'package:dpip/core/diagnostics/dump_uploader.dart';
/// Posts a dump and returns the URL to read it at.
///
/// A paste rather than an attachment because of where these end up: a bug
/// report in Discord or an issue, where 4000 characters of log pasted inline
/// buries everything around it and an attached file is not read at all.
/// report in Discord or an issue, where tens of thousands of characters of log
/// pasted inline buries everything around it and an attached file is not read
/// at all.
class HasteApi implements DumpUploader {
const HasteApi(this._client);

Expand Down
5 changes: 3 additions & 2 deletions lib/shared/diagnostics/dump_action.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ import 'package:talker_flutter/talker_flutter.dart';
///
/// The two halves answer different questions and a report needs both: the
/// diagnostics say what this build and this device are, the log says what they
/// just did. Pasting 4000 characters into a chat buries the conversation they
/// are part of, so they go to a paste and only the link comes back.
/// just did. Pasting tens of thousands of characters into a chat buries the
/// conversation they are part of, so they go to a paste and only the link
/// comes back.
///
/// Returns true when a link was produced. Failures are reported to the user
/// here and logged; the caller only has to stop showing its spinner.
Expand Down
5 changes: 3 additions & 2 deletions test/core/diagnostics/debug_dump_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,11 @@ void main() {
test('diagnostics are never cut to make room', () {
// A partial diagnostic reads as a complete one and is answered as if it
// were, which is worse than carrying no log at all.
final big = 'Version: 26w34b\n${'x' * 5000}';
// Sized past the limit so the log must be dropped for the diagnostics to fit.
final big = 'Version: 26w34b\n${'x' * (dumpLimit + 1000)}';
final out = buildDump(diagnostics: big, logLines: lines(50));
expect(out, contains('Version: 26w34b'));
expect(out, contains('x' * 5000));
expect(out, contains('x' * (dumpLimit + 1000)));
expect(out, isNot(contains('line 0')));
});

Expand Down
2 changes: 1 addition & 1 deletion test/core/logging/log_benign_assert_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/// into the log that sheet belongs to — a debug assert from talker_flutter,
/// which paints that sheet as a coloured box with bare `ListTile`s inside it.
/// Nothing this app can fix, and nothing a user is affected by, but it filled
/// the terminal, the log page and the 4000-character dump budget.
/// the terminal, the log page and the dump budget.
///
/// The tests here pin the two halves of the compromise: it is said once, so it
/// is on the record, and it is said only once, so it cannot flood. A real error
Expand Down
Loading