Chrome Home can display stale MostVisited tiles |
|||||||
Issue descriptionThe Java code for Chrome Home instantiates MostVisitedSitesBridge just once and reuses the object later on. This means Most Visited tiles are never updated (e.g. after user having typed a URL in the omnibox). As dgn@ and bauerb@ pointed out, ntpAdapter#refreshSuggestions should probably call MostVisitedSites::Refresh(), which mimics the behavior of the NTP because Refresh() is also called during construction (more precisely, during SetMostVisitedURLsObserver(). On java-land, there's no such API as Refresh(), but MostVisitedSites's setObserver() has the same side effect (subtle!). I suspect Chrome Home registers the observers just once, we should verify.
,
Sep 28 2017
,
Sep 29 2017
Update: LOG() messages in MostVisitedSites::Refresh and MostVisitedSites::SetMostVisitedURLsObserver are triggered every time ChromeHome is pulled up. The only path I could find for these updates is TileGroup::startObserving which is used in SiteSection and therefore NTPAdapter and NTPView. Is it possible that the lifespan of one of these objects is shorter than we would like? I exposed the MostVisited::Refresh method via MVBridge and included it in the NTPAdapter. This caused this log pattern whenever the sheet was pulled up: MostVisitedSites::SetObserver MostVisitedSites::OnMostVisitedURLsAvailable MostVisitedSites::Refresh MostVisitedSites::Refresh --> no further OnMostVisitedURLsAvailable as sites haven't changed after SetObserver. WIP CL here: http://crrev.com/c/692855 In other words: the tiles are always one cycle late but never stale for long.
,
Oct 10 2017
Bernhard & Nicolas, can you help me understand why SetObserver is called so frequently?
,
Oct 20 2017
Adding milestone and pinging the open question.
,
Oct 20 2017
MostVisitedURLsObserver is registered and listening for changes. So if the backend decides to notify the UI of a change, it will be picked up. It can be seen via transitions from the baked in tiles to the personalised ones on startup. So I'm missing the issue there. Is it that the native code does not have signal to fetch new data and push it to the UI?
,
Oct 20 2017
Ah right I get it. When the bottom sheet is closed, we kill the Zine UI. This is a change bauerb@ made some time ago. So I'd say it's WAI.
,
Oct 26 2017
Ok, so everything works but refreshing is still more a side-effect of a setter than something we consciously do. I just looked where we rely on that and the answer is: Everywhere (Win, iOS, tests). Therefore, I will leave this open (& reprioritize) as refactoring/cleanup until we require every caller to call Refresh explicitly.
,
Dec 14 2017
,
Jan 25 2018
Applying zine-maintenance label so new owners can decide whether this refactoring is still worth picking up.
,
Sep 17
Chrome Home is no longer under experimentation. |
|||||||
►
Sign in to add a comment |
|||||||
Comment 1 by fhorschig@chromium.org
, Sep 27 2017Status: Started (was: Assigned)