After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 725393 - The overview is empty at startup
The overview is empty at startup
Status: RESOLVED FIXED
Product: epiphany
Classification: Core
Component: Overview
git master
Other Linux
: Normal normal
: ---
Assigned To: Epiphany Maintainers
Epiphany Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-02-28 12:22 UTC by Carlos Garcia Campos
Modified: 2016-03-30 00:49 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
snapshot-service: Add a memory cache of snapshots paths saved (3.19 KB, patch)
2014-02-28 12:23 UTC, Carlos Garcia Campos
none Details | Review
snapshot-service: Update snapshots after one week (1.67 KB, patch)
2014-02-28 12:23 UTC, Carlos Garcia Campos
none Details | Review
snapshot-service: Add methods to get the snapshot path (9.54 KB, patch)
2014-02-28 12:23 UTC, Carlos Garcia Campos
none Details | Review
overview: Remove the overview model from the UI process (67.33 KB, patch)
2014-02-28 12:23 UTC, Carlos Garcia Campos
none Details | Review
snapshot-service: Add a memory cache of snapshots paths saved (3.19 KB, patch)
2014-02-28 17:37 UTC, Carlos Garcia Campos
committed Details | Review
snapshot-service: Update snapshots after one week (1.67 KB, patch)
2014-02-28 17:37 UTC, Carlos Garcia Campos
committed Details | Review
snapshot-service: Add methods to get the snapshot path (9.55 KB, patch)
2014-02-28 17:38 UTC, Carlos Garcia Campos
committed Details | Review
history-service: Also return the thumbnail time by ephy_history_service_query_urls (1.45 KB, patch)
2014-02-28 17:38 UTC, Carlos Garcia Campos
committed Details | Review
overview: Remove the overview model from the UI process (71.24 KB, patch)
2014-02-28 17:38 UTC, Carlos Garcia Campos
committed Details | Review

Description Carlos Garcia Campos 2014-02-28 12:22:13 UTC
This sometimes happens due to a race condition. The overview is built using the frecent store, but if the history query hasn't been completed yet when the overview page is built, the frecent store is empty and the overview html has no items. We should get rid of the model entirely in the UI process, since we are already keeping a simpler model in the web process to update the DOM when it changes. And the UI process is already notifying the web process about history changes without using the frecent store.
Comment 1 Carlos Garcia Campos 2014-02-28 12:23:20 UTC
Created attachment 270551 [details] [review]
snapshot-service: Add a memory cache of snapshots paths saved

And add a method to query that cache.
Comment 2 Carlos Garcia Campos 2014-02-28 12:23:25 UTC
Created attachment 270552 [details] [review]
snapshot-service: Update snapshots after one week
Comment 3 Carlos Garcia Campos 2014-02-28 12:23:29 UTC
Created attachment 270553 [details] [review]
snapshot-service: Add methods to get the snapshot path

This is useful for the new overview that doesn't need the actual
snapshot, but the path of the snapshot when it has been saved in the
cache.
Comment 4 Carlos Garcia Campos 2014-02-28 12:23:34 UTC
Created attachment 270554 [details] [review]
overview: Remove the overview model from the UI process

Now we query the history and snapshot services directly and the model is
used only in the web process. This fixes a race condition when the
overview page is created before the history query has completed leaving
an empty overview.
Comment 5 Claudio Saavedra 2014-02-28 13:47:49 UTC
Review of attachment 270552 [details] [review]:

::: lib/ephy-snapshot-service.c
@@ +488,3 @@
   /* Try to get the snapshot from the cache first if we have a URL */
   uri = webkit_web_view_get_uri (web_view);
+  if (uri && current_time - mtime <= SNAPSHOT_UPDATE_THRESHOLD)

IIRC we update the snapshots not only based on their age, but also on how frequently the page is visited. That way a page that's visited very often will be updated more frequently. This reduces that possibility.
Comment 6 Carlos Garcia Campos 2014-02-28 13:53:46 UTC
(In reply to comment #5)
> Review of attachment 270552 [details] [review]:
> 
> ::: lib/ephy-snapshot-service.c
> @@ +488,3 @@
>    /* Try to get the snapshot from the cache first if we have a URL */
>    uri = webkit_web_view_get_uri (web_view);
> +  if (uri && current_time - mtime <= SNAPSHOT_UPDATE_THRESHOLD)
> 
> IIRC we update the snapshots not only based on their age, but also on how
> frequently the page is visited. That way a page that's visited very often will
> be updated more frequently. This reduces that possibility.

Ah, it makes sense, I didn't notice that magic in the current code
Comment 7 Carlos Garcia Campos 2014-02-28 13:54:56 UTC
(In reply to comment #6)
> (In reply to comment #5)
> > Review of attachment 270552 [details] [review] [details]:
> > 
> > ::: lib/ephy-snapshot-service.c
> > @@ +488,3 @@
> >    /* Try to get the snapshot from the cache first if we have a URL */
> >    uri = webkit_web_view_get_uri (web_view);
> > +  if (uri && current_time - mtime <= SNAPSHOT_UPDATE_THRESHOLD)
> > 
> > IIRC we update the snapshots not only based on their age, but also on how
> > frequently the page is visited. That way a page that's visited very often will
> > be updated more frequently. This reduces that possibility.
> 
> Ah, it makes sense, I didn't notice that magic in the current code

Note that the time I'm passing there is the mtime stored in the history, not sure if that makes the trick, though
Comment 8 Claudio Saavedra 2014-02-28 14:03:15 UTC
Review of attachment 270553 [details] [review]:

::: lib/ephy-snapshot-service.c
@@ +705,3 @@
+  } else {
+    g_simple_async_result_run_in_thread (result,
+                                         (GSimpleAsyncThreadFunc)get_snapshot_url_for_url_thread,

get_snapshot_path_for_url_thread
Comment 9 Claudio Saavedra 2014-02-28 14:13:29 UTC
Review of attachment 270554 [details] [review]:

::: embed/ephy-web-view.c
@@ +1645,3 @@
 
+    if (!ephy_web_view_is_history_frozen (view) &&
+        ephy_embed_shell_get_mode (ephy_embed_shell_get_default ()) != EPHY_EMBED_SHELL_MODE_INCOGNITO) {

The incognito bits might probably deserve a split commit.
Comment 10 Carlos Garcia Campos 2014-02-28 17:37:53 UTC
Created attachment 270583 [details] [review]
snapshot-service: Add a memory cache of snapshots paths saved

And add a method to query that cache.
Comment 11 Carlos Garcia Campos 2014-02-28 17:37:58 UTC
Created attachment 270584 [details] [review]
snapshot-service: Update snapshots after one week
Comment 12 Carlos Garcia Campos 2014-02-28 17:38:04 UTC
Created attachment 270585 [details] [review]
snapshot-service: Add methods to get the snapshot path

This is useful for the new overview that doesn't need the actual
snapshot, but the path of the snapshot when it has been saved in the
cache.
Comment 13 Carlos Garcia Campos 2014-02-28 17:38:09 UTC
Created attachment 270586 [details] [review]
history-service: Also return the thumbnail time by ephy_history_service_query_urls
Comment 14 Carlos Garcia Campos 2014-02-28 17:38:16 UTC
Created attachment 270587 [details] [review]
overview: Remove the overview model from the UI process

Now we query the history and snapshot services directly and the model is
used only in the web process. This fixes a race condition when the
overview page is created before the history query has completed leaving
an empty overview.
Comment 15 Claudio Saavedra 2014-03-03 13:18:52 UTC
Review of attachment 270583 [details] [review]:

Good
Comment 16 Claudio Saavedra 2014-03-03 13:19:36 UTC
Review of attachment 270584 [details] [review]:

We can do this.
Comment 17 Claudio Saavedra 2014-03-03 13:20:16 UTC
Review of attachment 270585 [details] [review]:

OK
Comment 18 Claudio Saavedra 2014-03-03 13:24:55 UTC
Review of attachment 270586 [details] [review]:

Good
Comment 19 Claudio Saavedra 2014-03-03 13:29:26 UTC
Review of attachment 270587 [details] [review]:

Looks good.

::: embed/web-extension/ephy-web-overview.c
@@ +306,1 @@
+    /* Check if the model was updated while the overview was loading */

Checks whether…