Skip to content

fix: show feedback when a scanned QR code contains unsupported data#11248

Open
mvanhorn wants to merge 1 commit into
thunderbird:mainfrom
mvanhorn:fix/8520-qrcode-scan-feedback
Open

fix: show feedback when a scanned QR code contains unsupported data#11248
mvanhorn wants to merge 1 commit into
thunderbird:mainfrom
mvanhorn:fix/8520-qrcode-scan-feedback

Conversation

@mvanhorn

@mvanhorn mvanhorn commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Contribution Summary

Linked Issue/Ticket: Refs #8520
RFC / Technical Design (if applicable): N/A

Description

The "Import via QR code" flow silently ignores QR codes whose payload fails validation. QrCodeScannerViewModel.handleQrCodeScanned records the payload hash in unsupportedPayloadHashes and returns with no state change, so the bottom bar keeps showing the generic help text and the user sees no reaction at all. That is the top-reported symptom in #8520: the camera clearly frames the code (it scans fine in other apps), but nothing happens because desktop exports with invalid payload data (blank authentication type, missing encryption settings) are decoded and rejected without feedback.

This adds a DisplayText.UnsupportedQrCode variant to QrCodeScannerContract, sets it in the unsupported branch of handleQrCodeScanned, and renders it in QrCodeScannerView.buildString with a new migration_qrcode_unsupported_code string. A subsequent successful scan restores the progress text through the existing handleSupportedPayload path. Only the base values/strings.xml is edited; translations flow through Weblate.

Scope note: this converts the silent failure into actionable feedback. It deliberately does not touch desktop-side QR generation (different repo) or device-specific camera lens selection, which the issue thread tracks separately, so the body references the issue with Refs rather than Closes.

Screen Shots

N/A: the change adds one line of text to the existing scanner bottom bar, shown only when an unsupported code is scanned.

AI Disclosure

Select one of the following (mandatory)

  • This contribution does not include any changes created or assisted by AI.
  • This contribution includes changes assisted by AI.
  • This contribution includes changes created by AI.

Contribution Checklist

  • I have read and affirm that my contribution adheres to Mozilla’s Community Participation Guidelines
  • This contribution is in Kotlin where possible
  • This contribution does not use merge commits
  • This contribution adheres to the existing codestyle (run gradlew spotlessCheck to check and gradlew spotlessApply to format your source code; will be checked by CI).
  • This contribution does not break existing unit tests (run gradlew testDebugUnitTest; will be checked by CI).
  • This contribution includes tests for any new functionality, and maintains tests for any updated functionality.
  • This contribution adheres to our Engineering process (RFC/Technical Design/ADR)
  • This PR has a descriptive title and body that accurately outlines all changes made, and contains a reference to any issues that it fixes (e.g. Closes #XXX or Fixes #XXX).

@mvanhorn
mvanhorn requested a review from a team as a code owner July 8, 2026 06:45
@mvanhorn
mvanhorn requested a review from dani-zilla July 8, 2026 06:45
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Missing report label. Set exactly one of: report: include, report: exclude OR report: highlight.

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.

2 participants