Closed Bug 1900611 Opened 2 years ago Closed 2 years ago

TopSites getSites should wait until initialization is complete

Categories

(Firefox :: Top Sites, task, P2)

task

Tracking

()

RESOLVED FIXED
129 Branch
Tracking Status
firefox129 --- fixed

People

(Reporter: jteow, Assigned: jteow)

References

(Blocks 1 open bug)

Details

(Whiteboard: [sng])

Attachments

(1 file)

While trying to implement the integration with New Tab I realized that it's possible for multiple executions to getSites to return the wrong value.

Basically if one call to TopSites.getSites triggers an initialization, we flip the #inited flag. The subsequent call will then pass the check, at which point it will likely receive an empty array because TopSites hasn't finished initializing yet.

I also moved updateCustomSearchShortcuts into init because the TopSitesFeed implementation calls them both in the INIT action. This change avoids callers from knowing this relationship.

Pushed by jteow@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d8cb11d64dbb Have multiple calls to TopSites.getSites actually wait until init is complete - r=dao
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 129 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: