Closed Bug 1896265 Opened 1 year ago Closed 1 year ago

Re-integrate observation of events that should update the Top Sites component

Categories

(Firefox :: Top Sites, task, P2)

task

Tracking

()

RESOLVED FIXED
128 Branch
Tracking Status
firefox128 --- fixed

People

(Reporter: jteow, Assigned: jteow)

References

(Blocks 1 open bug)

Details

(Whiteboard: [sng])

Attachments

(9 files)

Even though onAction is essentially no-op and could be removed entirely, it might make more replace ones that can subscribe to changes without requiring the New Tab store to alert it (e.g. preference changes), and leave the actions that will need replacing by touching New Tab code.

To be specific, the Top Sites component should update its internal state under the following conditions:

  • A change occurs in Places.
  • A dependent preference changes state or has its initial values set.
  • Top Sites has a pinned/unpinned site.
  • A new top site is inserted.
  • A pinned search shortcut needs to be updated.

Some investigation should be done to see if we also need to carry over:

  • Initialization
  • Un-initialization
  • System tick
Summary: Replace some onActions with observers → Re-integrate observation of events that should update the Top Sites component
Blocks: 1891980
Assignee: nobody → jteow
Status: NEW → ASSIGNED

It's mostly helpful for browser tests to reset TopSites.

Depends on D211424

Attachment #9403585 - Attachment description: Bug 1896265 - Part 7: Update TopSites on an interval - r?dao! → Bug 1896265 - Part 7: Remove periodic updates of TopSites - r?dao!
Pushed by jteow@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/256e6601fd8c Part 1: Listen to Places events - r=dao https://hg.mozilla.org/integration/autoland/rev/4f017b452f96 Part 2: Force consumers to call TopSites.pin and TopSites.unpin directly - r=dao https://hg.mozilla.org/integration/autoland/rev/d72d56a01f45 Part 3: Force consumers to use TopSites.insert - r=dao https://hg.mozilla.org/integration/autoland/rev/412b814bf7bb Part 4: Rely on TopSites.updatePinnedSearchShortcuts to update search shortcuts - r=dao https://hg.mozilla.org/integration/autoland/rev/4d3e8de49e3b Part 5: Change main entry points to update search shortcuts and remove init/uninit from onActions - r=dao https://hg.mozilla.org/integration/autoland/rev/88ad64c18ce2 Part 6: Subscribe to all relevant preference changes - r=dao https://hg.mozilla.org/integration/autoland/rev/1a8aabb26f46 Part 7: Remove periodic updates of TopSites - r=dao https://hg.mozilla.org/integration/autoland/rev/62cd841e0d90 Part 8: Remove initial preference values event - r=dao https://hg.mozilla.org/integration/autoland/rev/1742a6a7f0f6 Part 9: Expire link caches on un-initialization - r=dao
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: