Closed Bug 1832704 Opened 2 years ago Closed 2 years ago

Remove SearchService's init-complete, replace by a promise that resolves or rejects as appropraite

Categories

(Firefox :: Search, task, P3)

task

Tracking

()

RESOLVED FIXED
120 Branch
Tracking Status
firefox120 --- fixed

People

(Reporter: mcheang, Assigned: standard8)

References

Details

Attachments

(1 file)

We send the "init-complete" notification regardless if SearchService initialization has failed or succeeded. Instead, we should send "init-failed" notification when SearchService has failed.

We are sending "init-complete" notification in SearchService.#init here

Extension System waits for "init-complete" here.

First, we need to create the "init-failed" notification by calling notifyObservers. Then, there needs to be further investigation on how external callers will handle the new "init-failed" notification.

Severity: -- → N/A
Depends on: 1849918
Depends on: 1849924

We took a look at this and decided that it would be better to remove the "init-complete" notification. Instead, we can add a promiseInitialized property that will resolve when the search service has successfully initialized, or reject if it has failed. Note, that this will not trigger initialization, unlike calling init().

This should be clearer and easier that trying to observe notifications and handling them appropriately. It also means that logic for detecting when the search service has finished initialising is all contained within the search service.

Summary: SearchService's "init-complete" notification is not consistent. The notification is sent when SearchService has failed. → Remove SearchService's init-complete, replace by a promise that resolves or rejects as appropraite
Assignee: nobody → standard8
Status: NEW → ASSIGNED
Attachment #9351706 - Attachment description: Bug 1832704 - Remove SearchService's init-complete, replace by a promise that resolves or rejects as appropraite. r?mcheang! → Bug 1832704 - Remove SearchService's init-complete, replace by a promise that resolves or rejects as appropriate. r?mcheang!
Pushed by mbanner@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/f0a2aa2ffe6d Remove SearchService's init-complete, replace by a promise that resolves or rejects as appropriate. r=mcheang,extension-reviewers,robwu
Pushed by mbanner@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/b6b3f678da8b Remove SearchService's init-complete, replace by a promise that resolves or rejects as appropriate. r=mcheang,extension-reviewers,robwu
Flags: needinfo?(standard8)
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 120 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: