Closed Bug 1914380 Opened 2 months ago Closed 2 months ago

broken search, TypeError: can't access property "name", engine is null in SearchModeSwitcher.sys.mjs

Categories

(Firefox :: Search, defect)

defect

Tracking

()

RESOLVED FIXED
131 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox-esr128 --- unaffected
firefox129 --- unaffected
firefox130 --- unaffected
firefox131 blocking fixed

People

(Reporter: jcristau, Assigned: mbeier)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

After updating to the latest nightly (20240822092117), the address bar and new tab won't search; browser console shows TypeErrors:

TypeError: can't access property "name", engine is null at SearchModeSwitcher.sys.mjs:227:16, followed by

TypeError: can't access property "replace", engine.id is undefined
    get resource://gre/modules/SearchSettings.sys.mjs:222
ContentSearchParent.sys.mjs:372:17
    _currentEventPromise resource:///actors/ContentSearchParent.sys.mjs:372
    _processEventQueue resource:///actors/ContentSearchParent.sys.mjs:378
    receiveMessage resource:///actors/ContentSearchParent.sys.mjs:676
    (Async: JSActor query)
    handleEvent resource:///actors/ContentSearchChild.sys.mjs:11
    _sendMsg chrome://browser/content/contentSearchHandoffUI.js:150
    ContentSearchHandoffUIController chrome://browser/content/contentSearchHandoffUI.js:13
    onInputMountHandoff resource://activity-stream/data/content/activity-stream.bundle.js:10123
    React 11
    Redux 4
    messageMiddleware resource://activity-stream/data/content/activity-stream.bundle.js:11634
    rehydrationMiddleware resource://activity-stream/data/content/activity-stream.bundle.js:11667
    initStore resource://activity-stream/data/content/activity-stream.bundle.js:11708
    receiveMessage resource://gre/actors/RemotePageChild.sys.mjs:106
    (Async: JSActor query)
    send resource://activity-stream/lib/ActivityStreamMessageChannel.sys.mjs:125
    middleware resource://activity-stream/lib/ActivityStreamMessageChannel.sys.mjs:74
    _middleware resource://activity-stream/lib/Store.sys.mjs:49
    method resource://activity-stream/lib/Store.sys.mjs:28
    reply resource://activity-stream/lib/NewTabInit.sys.mjs:29
    onAction resource://activity-stream/lib/NewTabInit.sys.mjs:41
    _middleware resource://activity-stream/lib/Store.sys.mjs:52
    method resource://activity-stream/lib/Store.sys.mjs:28
    onActionFromContent resource://activity-stream/lib/ActivityStreamMessageChannel.sys.mjs:94
    onMessage resource://activity-stream/lib/ActivityStreamMessageChannel.sys.mjs:331
    notifyActivityStreamChannel resource:///actors/AboutNewTabParent.sys.mjs:135
    receiveMessage resource:///actors/AboutNewTabParent.sys.mjs:103
    (Async: JSActor query)
    RPMSendAsyncMessage resource://gre/actors/RemotePageChild.sys.mjs:146
    accessCheckedFn resource://gre/actors/RemotePageChild.sys.mjs:77
    messageMiddleware resource://activity-stream/data/content/activity-stream.bundle.js:11631
    rehydrationMiddleware resource://activity-stream/data/content/activity-stream.bundle.js:11662
    doRequest resource://activity-stream/data/content/activity-stream.bundle.js:11759
    (Async: requestIdleCallback handler)
    renderWithoutState resource://activity-stream/data/content/activity-stream.bundle.js:11765
    <anonymous> resource://activity-stream/data/content/newtab-render.js:10
    handleEvent resource:///actors/AboutNewTabChild.sys.mjs:70

[Tracking Requested - why for this release]: I've paused nightly updates for this.

Flags: needinfo?(mbeier)

Set release status flags based on info from the regressing bug 1870687

Does this depend on having browser.urlbar.scotchBonnet.enableOverride set to true?
Ah it's likely just the switcher complaining about search engines being broken (Bug 1914390 and Bug 1906541 are tracking those problems)

Summary: broken search, TypeError: can't access property "name", engine is null → broken search, TypeError: can't access property "name", engine is null in SearchModeSwitcher.sys.mjs

I was able to get a search.json.mozlz4 file that reproduces this and discovered this within it:

{
  "_name": "Amazon.com",
  "_isAppProvided": true,
  "_metaData": {
    "hideOneOffButton": false
  }
}

The rest of the _isAppProvided engines all have an id set.

I think what's happened here is:

  • The profile had previously been used in more than one locale or region, meaning that Amazon.com was at some stage in the past displayed.
  • When we implemented settings version 7, we added a migration which filled in the engine ids based on searching the installed engines and looking them up by name.
    • Where the name doesn't exist, the entry is left alone, and has no id value.
  • We've now implemented a migration for the id value itself, which does a replacement within the string - however this fails when there's no string (i.e. no id) available.
See Also: → 1906541
Assignee: nobody → mbeier
Status: NEW → ASSIGNED
Flags: needinfo?(mbeier)
Pushed by mbanner@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/191d393bab12 broken search, TypeError: can't access property name, engine is null in SearchModeSwitcher.sys.mjs. r=Standard8
Pushed by nfay@mozilla.com: https://hg.mozilla.org/mozilla-central/rev/4db772ac6fb4 broken search, TypeError: can't access property name, engine is null in SearchModeSwitcher.sys.mjs. r=Standard8 a=graft
Status: ASSIGNED → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 131 Branch

I am attempting to reproduce your issue by running Nightly build 20240822092117 and performing some searching from the new tab and the awesomebar. No issues or errors were observed.

The mentioned features are handled by Adrian Florinescu so I will pass this report along to him. Thank you!

Flags: needinfo?(aflorinescu)

FYI, couldn't reproduce it reliable with rather exaustive time investment, so setting qe- for now.
Further discussing with :standard8, this is related to with locale switching & upgrading, so it is rather hard to verify/cover over with reccurent manual testing.

Flags: qe-verify-
Flags: qe-verify+
Flags: needinfo?(aflorinescu)
Flags: in-qa-testsuite-
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: