Skip to content

Fix issue report screenshot size validation#8757

Merged
atavism merged 4 commits into
mainfrom
atavism/screenshot-limit
May 19, 2026
Merged

Fix issue report screenshot size validation#8757
atavism merged 4 commits into
mainfrom
atavism/screenshot-limit

Conversation

@atavism

@atavism atavism commented May 14, 2026

Copy link
Copy Markdown
Contributor

Resolves https://github.com/getlantern/engineering/issues/3466

Updates report-issue attachment validation so the screenshot limit only counts selected screenshots, not hidden diagnostic/log bytes. This prevents false attachment size exceeded errors when users submit logs with no visible attachment

Copilot AI review requested due to automatic review settings May 14, 2026 16:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Removes the "reserved bytes" attachment budget that pre-counted hidden diagnostic/log file sizes against the screenshot attachment limit. After this change, the maxTotalBytes cap applies only to user-selected screenshots, eliminating false "attachment size exceeded" errors when logs are present but no screenshot is attached.

Changes:

  • Deletes attachment_budget.dart and its test, and removes reservedBytes parameter from validateAttachments / addAttachments and the submitter validation path.
  • Updates report_issue.dart to drop the budget lookup before adding attachments.
  • Updates tests to remove the fake budget and adjust the oversize test to use maxTotalBytes + 1.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
lib/features/report_issue/models/report_issue_attachment_rules.dart Drops reservedBytes from validateAttachments size check.
lib/features/report_issue/provider/attachment_budget.dart Deletes the entire budget abstraction (also removes the ReportIssueLogFileResolver typedef and default resolver).
lib/features/report_issue/provider/submitter.dart Removes budget dependency; switches import to a (currently non-existent) log_file_resolver.dart.
lib/features/report_issue/provider/report_issue_draft_notifier.dart Removes reservedBytes parameter from addAttachments.
lib/features/report_issue/report_issue.dart Stops reading the budget before invoking addAttachments.
test/features/report_issue/report_issue_test.dart Removes the fake budget and adjusts oversize-screenshot expectation.
test/features/report_issue/report_issue_submitter_test.dart Removes fake budget overrides; oversize test now uses maxTotalBytes + 1.
test/features/report_issue/report_issue_attachment_budget_test.dart Deletes the now-obsolete budget test file.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/features/report_issue/provider/submitter.dart
@myleshorton

Copy link
Copy Markdown
Contributor

See copilot comment

@atavism atavism requested review from jigar-f and myleshorton May 15, 2026 16:57
@atavism

atavism commented May 15, 2026

Copy link
Copy Markdown
Contributor Author

See copilot comment

I added the missing file

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated no new comments.

@jigar-f jigar-f left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@atavism atavism merged commit f510348 into main May 19, 2026
8 checks passed
@atavism atavism deleted the atavism/screenshot-limit branch May 19, 2026 06:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants