Remove or refactor reInit
Categories
(Firefox :: Search, task, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox82 | --- | fixed |
People
(Reporter: mixedpuppy, Assigned: standard8)
References
Details
Attachments
(3 files)
In bug 1556789 I fixed search.init to return the actual promise that is resolved/rejected during initialization. This fixed the ability to actually use then/catch on the promise.
reInit is a funky thing, but it can be fixed. Basically the primary item that is introduces is flushing the cache file. It then replicates search.reset and search.init.
reInit should become an async, returning a Promise in the IDL. It should then simply flush the cache, call reset, then return Init. This will reduce code duplication and make it possible to get rid of a bunch of observer code used to detect when reinit is done.
Reporter | ||
Comment 1•5 years ago
|
||
I'd actually consider adding a flush param to reset and have reset flush the cache. Then tests should call reset and init.
Comment 2•5 years ago
|
||
The priority flag is not set for this bug.
:daleharvey, could you have a look please?
For more information, please visit auto_nag documentation.
Updated•5 years ago
|
Assignee | ||
Comment 3•5 years ago
|
||
With the work currently ongoing to tidy up the search service, we'd are thinking about either removing or refactoring reInit. It has crept into production code, but really it shouldn't be necessary - we should be able to handle changes of configuration correctly, even if it is a big change.
If a test really needs to clean the search service out, then we should reconsider what we're actually testing, and why, and see if there's an alternative - if we really need to, then create a new search service object.
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 4•4 years ago
|
||
test_json_cache_broken.js is a nicer test that doesn't need reInit and tests more, so remove the older test_require_engines_in_cache.js.
Depends on D88274
Assignee | ||
Comment 5•4 years ago
|
||
Depends on D88275
Assignee | ||
Comment 6•4 years ago
|
||
Depends on D88276
Comment 9•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/48c95b737c1b
https://hg.mozilla.org/mozilla-central/rev/36fdfab5156a
https://hg.mozilla.org/mozilla-central/rev/7101ff70c61f
Assignee | ||
Updated•4 years ago
|
Description
•