Search settings use name instead of id to check if app provided search engine is inactive
Categories
(Firefox :: Search, defect, P2)
Tracking
()
People
(Reporter: mbeier, Assigned: cachan)
References
Details
(Keywords: good-next-bug, Whiteboard: [sng])
Attachments
(1 file)
In this line, search settings persists old entries for app provided engines if no app provided engine with the entry's name is currently available. If we rename an app provided engine, search settings will create a new entry with the new name but also keep the old entry with the old name but same id.
The following test case
const CONFIG = [{ identifier: "default" }];
add_setup(async function () {
SearchTestUtils.updateRemoteSettingsConfig(CONFIG);
await Services.search.init();
});
add_task(async function () {
CONFIG[0].base = { name: "default2" };
await SearchTestUtils.updateRemoteSettingsConfig(CONFIG);
let settings = await Services.search.wrappedJSObject._settings.get();
console.log(settings.engines);
});
produces the following output
[{id:"default", _name:"default2", _isAppProvided:true, _metaData:{}}, {id:"default", _name:"default", _isAppProvided:true, _metaData:{}}]
This doesn't cause the search service to crash immediately, but I think it might still lead to issues.
Updated•1 year ago
|
Updated•1 year ago
|
Updated•5 months ago
|
Updated•4 months ago
|
Backed out for causing xpc failures @ test_override_allowlist_switch.js
Updated•4 months ago
|
ID checking ensures if an engine is renamed, we don't save both engines while checking names ensures if a different engine overrides an inactive engine, we don't save both and cause a collision on next startup.
test_override_allowlist_switch.js failed because of the name comparison removal, so both ID and name comparisons were added
Comment 5•3 months ago
|
||
There is an r+ patch which didn't land and no activity in this bug for 1 week.
:cachan, could you have a look please?
If you still have some work to do, you can add an action "Plan Changes" in Phabricator.
For more information, please visit BugBot documentation.
Updated•3 months ago
|
Comment 7•3 months ago
|
||
| bugherder | ||
Updated•3 months ago
|
Updated•3 months ago
|
Description
•