Fix the "Unknown source for one-off search: urlbar" error when doing one-off searches

RESOLVED FIXED in Firefox 51

Status

()

Firefox
Search
P1
normal
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: Dexter, Assigned: Dexter)

Tracking

Trunk
Firefox 52
Points:
1

Firefox Tracking Flags

(firefox51 fixed, firefox52 fixed)

Details

(Whiteboard: [measurement:client])

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

2 years ago
> Unknown source for one-off search: urlbar  BrowserUsageTelemetry.jsm:276

This is happening due to the code that landed in bug 1303333. The counts from the one-off searches originating from the urlbar or the searchbar are still being counted (checked in about:telemetry).

However, this exception is thrown because the search code calls BrowserUsageTelemetry.recordSearch twice: one time flagging the search as a one-off, the other time marking it as a normal search.

As a consequence, BrowserUsageTelemetry.recordSearch throws.
(Assignee)

Updated

2 years ago
Assignee: nobody → alessio.placitelli
Blocks: 1303333
Points: --- → 1
Priority: -- → P1
Whiteboard: [measurement:client]
(Assignee)

Comment 1

2 years ago
Created attachment 8806789 [details] [diff] [review]
bug1314650.patch

This simply drops the exception if it comes from the 'urlbar' or 'searchbar', as they're the ones calling the function twice.
Attachment #8806789 - Flags: review?(mak77)
Comment on attachment 8806789 [details] [diff] [review]
bug1314650.patch

Review of attachment 8806789 [details] [diff] [review]:
-----------------------------------------------------------------

::: browser/modules/BrowserUsageTelemetry.jsm
@@ +274,5 @@
>      if (isOneOff) {
>        if (!KNOWN_ONEOFF_SOURCES.includes(source)) {
> +        // Silently drop the error if this bogus call
> +        // came from 'urlbar' or 'searchbar'. They're buggy
> +        // and are calling |recordSearch| twice.

If we're calling them buggy, we'd better add here the bug # that is going to solve the problem, otherwise future readers will have to figure that out every time.
Attachment #8806789 - Flags: review?(mak77) → review+
(Assignee)

Comment 3

2 years ago
Created attachment 8807240 [details] [diff] [review]
bug1314650.patch

I changed the comment to explain the situation rather than claiming the code is buggy.
Attachment #8806789 - Attachment is obsolete: true
Attachment #8807240 - Flags: review+
(Assignee)

Updated

2 years ago
Keywords: checkin-needed

Comment 5

2 years ago
Pushed by ihsiao@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/43b69e748e78
Fix the "Unknown source for one-off search: urlbar" error when doing one-off searches. r=mak
Keywords: checkin-needed

Comment 6

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/43b69e748e78
Status: NEW → RESOLVED
Last Resolved: 2 years ago
status-firefox52: affected → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 52
(Assignee)

Comment 7

2 years ago
Comment on attachment 8807240 [details] [diff] [review]
bug1314650.patch

Approval Request Comment
[Feature/regressing bug #]: Bug 1303333.
[User impact if declined]: The browser console will show an exception even though no error really occurred.
[Describe test coverage new/current, TreeHerder]: Test coverage is already in place from bug 1303333.
[Risks and why]: No risk, as this basically mutes an exception.
[String/UUID change made/needed]: None.
Attachment #8807240 - Flags: approval-mozilla-aurora?

Updated

2 years ago
status-firefox51: --- → affected
Hi Alessio,
I remember that one-off search is enabled in nightly only. Do we need to uplift this to 51 aurora?
Flags: needinfo?(alessio.placitelli)
(Assignee)

Comment 9

2 years ago
(In reply to Gerry Chang [:gchang] from comment #8)
> Hi Alessio,
> I remember that one-off search is enabled in nightly only. Do we need to
> uplift this to 51 aurora?

Hi Gerry!

Yes please, let's uplift that too so that the code is in sync in case any weird issue arises.
Flags: needinfo?(alessio.placitelli)
Comment on attachment 8807240 [details] [diff] [review]
bug1314650.patch

Fix an error in browser console related to one-off search. Take it in 51 aurora.
Attachment #8807240 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
(Assignee)

Updated

2 years ago
status-firefox51: affected → fixed
You need to log in before you can comment on or make changes to this bug.