[omnibox] "TypeError: this._searchFinishedCallback is not a function"

RESOLVED FIXED in Firefox 55

Status

()

Toolkit
WebExtensions: Frontend
P3
normal
RESOLVED FIXED
3 months ago
a month ago

People

(Reporter: robwu, Assigned: mattw)

Tracking

(Blocks: 1 bug)

52 Branch
mozilla55
Points:
---

Firefox Tracking Flags

(firefox55 fixed)

Details

(Whiteboard: [omnibox]triaged)

MozReview Requests

()

Submitter Diff Changes Open Issues Last Updated
Loading...
Error loading review requests:

Attachments

(1 attachment)

(Reporter)

Description

3 months ago
Version: Firefox Nightly: 54.0a1 (2017-02-07)

Steps to reproduce:

1. Create a directory with the following manifest.json:
{
    "name": "omnibox test",
    "version": "1",
    "manifest_version": 2,
    "omnibox": {
        "keyword": "test"
    }
}
2. Visit about:debugging and select manifest.json.
3. Focus the awesomebar and type "test " (including space).
4. Press backspace.
5. Open the global console (which implicitly closes the suggestions list).

The console shows the following error. The first error occurs after step 4, the second error after step 5.

this._searchFinishedCallback is not a function  ExtensionSearchHandler.jsm:72
	cancel resource://gre/modules/ExtensionSearchHandler.jsm:72:5
	handleInputCancelled resource://gre/modules/ExtensionSearchHandler.jsm:289:5
	Search.prototype.execute< resource://gre/components/UnifiedComplete.js:992:7
	next self-hosted:1117:9
	TaskImpl_run resource://gre/modules/Task.jsm:319:42
	bound TaskImpl_run self-hosted:955:17
TypeError: this._searchFinishedCallback is not a function  ExtensionSearchHandler.jsm:72:5
	cancel resource://gre/modules/ExtensionSearchHandler.jsm:72:5
	handleInputCancelled resource://gre/modules/ExtensionSearchHandler.jsm:289:5
	onxblblur chrome://browser/content/urlbarBindings.xml:1240:11
(Assignee)

Updated

3 months ago
Blocks: 1166831
Component: WebExtensions: General → WebExtensions: Frontend
Priority: -- → P3
Whiteboard: [omnibox]triaged
(Assignee)

Comment 1

3 months ago
This bug occurs specifically when an input session is cancelled or submitted after an input session is started but before any onInputChanged events are fired.
Comment hidden (mozreview-request)
(Assignee)

Updated

3 months ago
Assignee: nobody → mwein
(Reporter)

Comment 3

3 months ago
mozreview-review
Comment on attachment 8837112 [details]
Bug 1339250 - Fix error caused by ending an input session immediately after the session is started

https://reviewboard.mozilla.org/r/112356/#review113652

::: toolkit/components/places/ExtensionSearchHandler.jsm:80
(Diff revision 1)
>      this._extension.emit(eventName);
>    }
>  
>    end(eventName, text, disposition) {
> +    if (this._searchFinishedCallback) {
> -    this._searchFinishedCallback();
> +      this._searchFinishedCallback();

It seems that the callback is expected to be called only once (http://searchfox.org/mozilla-central/rev/d3307f19d5dac31d7d36fc206b00b686de82eee4/toolkit/components/places/ExtensionSearchHandler.jsm#232), so maybe it would be good to explicitly null the callback (also the `_suggestionsCallback`) to communicate intent?

And does `addSuggestions` need a null-check too?
Attachment #8837112 - Flags: review?(rob) → review+
(Assignee)

Comment 4

a month ago
mozreview-review-reply
Comment on attachment 8837112 [details]
Bug 1339250 - Fix error caused by ending an input session immediately after the session is started

https://reviewboard.mozilla.org/r/112356/#review113652

> It seems that the callback is expected to be called only once (http://searchfox.org/mozilla-central/rev/d3307f19d5dac31d7d36fc206b00b686de82eee4/toolkit/components/places/ExtensionSearchHandler.jsm#232), so maybe it would be good to explicitly null the callback (also the `_suggestionsCallback`) to communicate intent?
> 
> And does `addSuggestions` need a null-check too?

I've updated the patch to null out the callbacks to communicate intent - I think `addSuggestsion` does need a null-check after this change.
Comment hidden (mozreview-request)
(Assignee)

Updated

a month ago
Keywords: checkin-needed

Comment 6

a month ago
Pushed by ihsiao@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/efa1ee67e2f1
Fix error caused by ending an input session immediately after the session is started r=robwu
Keywords: checkin-needed

Comment 7

a month ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/efa1ee67e2f1
Status: NEW → RESOLVED
Last Resolved: a month ago
status-firefox55: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in before you can comment on or make changes to this bug.