Closed Bug 2073545 Opened 2 months ago Closed 2 months ago

[HNT] QR code search on homepage opens in a new tab

Categories

(Firefox for Android :: Homepage, defect)

All
Android
defect

Tracking

()

RESOLVED FIXED
158 Branch
Tracking Status
firefox158 --- verified

People

(Reporter: npoon, Assigned: npoon)

References

(Blocks 1 open bug)

Details

(Whiteboard: [fxdroid] [group5])

Attachments

(1 file, 1 external file, 1 obsolete file)

Steps to reproduce

  1. Open a homepage tab
  2. Scan a QR code

Expected behavior

Scanned link is opened in the homepage tab

Actual behavior

A new tab is opened to open the scanned link

observeQrScannerInput in BrowserToolbarSearchMiddleware.kt is the one loadUrlOrSearch call site in that file that computes newTab without the homepage-as-new-tab short-circuit, passing newTab = appStore.state.searchState.sourceTabId == null at #604. A search started from the homepage toolbar dispatches SearchStarted() with a null tab id (BrowserToolbarMiddleware.kt), so the scan result reaches tabsUseCases.addTab in FenixBrowserUseCases.kt instead of loading into the current tab.

Fix: Use the same expression openSearchOrUrl already uses at #341-349, if (settings.enableHomepageAsNewTab) false else appStore.state.searchState.sourceTabId == null, since settings is already a constructor field of the middleware. Add an HNT-enabled QR case to BrowserToolbarSearchMiddlewareTest.kt next to the existing enableHomepageAsNewTab commit tests.

Suggested severity: S3. The scanned link does load correctly and the only cost is a stray extra tab the user can close, and the affected flag is currently on for nightly and developer builds only.


If you'd like to provide feedback on this comment, please use the 👍 or 👎 reaction.
If you want to categorize your feedback you can add one of the following tags: ai-triage-wrong-file, ai-triage-wrong-cause, ai-triage-hallucination, ai-triage-out-of-scope, ai-triage-wrong-fix, ai-triage-shallow-fix.

Needinfo hackbot@mozilla.tld to have a patch generated for this bug, include any questions or directions as needed in your comment.

Assignee: nobody → npoon
Status: NEW → ASSIGNED
Status: ASSIGNED → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 158 Branch
Flags: qe-verify+

Hey QA,
Can we also confirm that the behaviour for homepage as new tab off hasn't changed? Thanks

Verified as fixed on Nightly 159.0a1 with Samsung S23 Ultra(Android 14) and Pixel 3 XL (Android 9). Also the behaviour of HNT off is not changed.

Attachment #9648384 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: