Remove nsISearchEngine.identifier
Categories
(Firefox :: Search, task, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox145 | --- | fixed |
People
(Reporter: standard8, Assigned: standard8)
References
Details
(Whiteboard: [sng][search-tech-debt])
Attachments
(3 files)
On nsISearchEngine we currently have three properties that all mention "identifier" in some form:
id- the internal identifier of the search engine.telemetryId- the telemetry identifier of the search engine.identifier- if this is an application provided engine, this returns thetelemetryId, otherwise it returns null.
This is confusing, as it really isn't clear what identifier is for.
Additionally, it isn't always obvious that identifier may return null, e.g. this code which returns an array containing nulls if third party search engines are installed.
Another example is filtering the identifier for falsy values without mentioning why this is or might be necessary.
Therefore I think we should remove identifier and replace its use with telemetryId. If we need to filter out third party engines, then we can check the isAppProvided property of the engine.
The other alternative would be to replace identifier with a function, e.g. getTelemetryId({ includeThirdParty: true}) so that it is explicit to include third party.
I'm not sure which method I like most at the moment.
Updated•2 years ago
|
| Assignee | ||
Comment 1•7 months ago
|
||
Looking at the production code, I think the only instances of code using this is in UITour & ASRouter, I've filed bug 1976703 and bug 1976706 about fixing those - which both seem viable.
However there may be some instances not picked up by the query, so we should be careful when removing this (maybe a try run with identifier throwing).
The only identifier like properties remaining should be id and telemetryId.
| Assignee | ||
Comment 2•6 months ago
|
||
We should also annotate telemetryId with being obsolete, to try and avoid its use in new code.
| Assignee | ||
Comment 3•5 months ago
|
||
Also adds more detailed type definitions to aid with understanding/future development.
Updated•5 months ago
|
| Assignee | ||
Comment 4•5 months ago
|
||
Also fixes/adds an explicit check for no client parameter in some situations.
| Assignee | ||
Comment 5•5 months ago
|
||
The identifier was a mixture of different fields, and the 'id' and other fields should be preferred.
The 'telemetryId' field is also deprecated in favour of other fields.
Comment 7•4 months ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/b6386efccc85
https://hg.mozilla.org/mozilla-central/rev/7b4e2ac938fc
https://hg.mozilla.org/mozilla-central/rev/7486ae59d969
Updated•4 months ago
|
Description
•