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 791518 - Initialize the getting started PDF only when presenting a UI, and before any SPARQL has been submitted
Initialize the getting started PDF only when presenting a UI, and before any ...
Status: RESOLVED FIXED
Product: gnome-documents
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: GNOME documents maintainer(s)
GNOME documents maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2017-12-12 15:11 UTC by Debarshi Ray
Modified: 2018-06-15 05:04 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
application: Insert the getting started PDF only when showing a window (1.38 KB, patch)
2017-12-12 16:00 UTC, Debarshi Ray
none Details | Review
application: Make window creation complete asynchronously (4.84 KB, patch)
2017-12-12 16:00 UTC, Debarshi Ray
none Details | Review
application: Tie the catch block more tightly to the failure site (2.14 KB, patch)
2017-12-12 16:01 UTC, Debarshi Ray
committed Details | Review
application: Shuffle some code around (1.21 KB, patch)
2017-12-12 16:01 UTC, Debarshi Ray
none Details | Review
application: Create the window only after detecting the PDF (3.65 KB, patch)
2017-12-12 16:01 UTC, Debarshi Ray
none Details | Review
trackerController: Don't submit queries until started (771 bytes, patch)
2017-12-12 16:01 UTC, Debarshi Ray
none Details | Review
trackerController: Assert against premature queries (1.60 KB, patch)
2017-12-12 16:02 UTC, Debarshi Ray
none Details | Review
application: Tie the catch block more tightly to the failure site (2.14 KB, patch)
2018-06-06 17:43 UTC, Debarshi Ray
committed Details | Review
application: Synchronously initialize the getting started PDF (3.26 KB, patch)
2018-06-06 18:48 UTC, Debarshi Ray
committed Details | Review
trackerController: Don't submit queries until started (848 bytes, patch)
2018-06-06 18:48 UTC, Debarshi Ray
committed Details | Review
trackerController: Assert against premature queries (1.60 KB, patch)
2018-06-06 18:49 UTC, Debarshi Ray
committed Details | Review
application: Insert the getting started PDF only when showing a window (1.38 KB, patch)
2018-06-06 18:49 UTC, Debarshi Ray
committed Details | Review

Description Debarshi Ray 2017-12-12 15:11:27 UTC
There are some problems with our handling of the getting started PDF.

The code to detect and index it is shared with the search provider, which means that it runs on every gnome-shell search. This is a bit wasteful. We should try to keep the search providers as lean as possible. I think that we should treat it like the online content. ie., we need not have to guarantee knowing about it until someone has invoked the application at least once.

Secondly, we should finish initializing the getting started PDF before submitting any SPARQL for the application. Otherwise, the queries won't include the PDF's path and will be missing. For example, if you can get the timing just right on an empty system, the TrackerControllers issue the queries just before the PDF is initialized, but the following queries to update the OffsetControllers' happens right after. This leads to an empty ViewContainer, but the no-results page isn't shown because the OffsetController isn't empty. Subsequent CHANGED events from TrackerChangeMonitor are ignored because the document isn't already in the DocumentManager.
Comment 1 Debarshi Ray 2017-12-12 16:00:40 UTC
Created attachment 365437 [details] [review]
application: Insert the getting started PDF only when showing a window
Comment 2 Debarshi Ray 2017-12-12 16:00:53 UTC
Created attachment 365438 [details] [review]
application: Make window creation complete asynchronously
Comment 3 Debarshi Ray 2017-12-12 16:01:12 UTC
Created attachment 365439 [details] [review]
application: Tie the catch block more tightly to the failure site
Comment 4 Debarshi Ray 2017-12-12 16:01:21 UTC
Created attachment 365440 [details] [review]
application: Shuffle some code around
Comment 5 Debarshi Ray 2017-12-12 16:01:33 UTC
Created attachment 365441 [details] [review]
application: Create the window only after detecting the PDF
Comment 6 Debarshi Ray 2017-12-12 16:01:53 UTC
Created attachment 365442 [details] [review]
trackerController: Don't submit queries until started
Comment 7 Debarshi Ray 2017-12-12 16:02:19 UTC
Created attachment 365443 [details] [review]
trackerController: Assert against premature queries
Comment 8 Debarshi Ray 2017-12-12 16:17:48 UTC
These patches are also in gnome-documents:wip/rishi/init-getting-started.
Comment 9 Cosimo Cecchi 2017-12-18 16:27:42 UTC
Review of attachment 365437 [details] [review]:

Makes sense, thanks.
Comment 10 Cosimo Cecchi 2017-12-18 19:06:42 UTC
Review of attachment 365438 [details] [review]:

I'm not sure this is strictly needed... It should be fine to synchronously locate the getting started document during app startup, before the tracker controllers are started, no?
Comment 11 Cosimo Cecchi 2017-12-18 19:08:23 UTC
Review of attachment 365439 [details] [review]:

Looks good.
Comment 12 Cosimo Cecchi 2017-12-18 19:08:36 UTC
Review of attachment 365440 [details] [review]:

OK
Comment 13 Cosimo Cecchi 2017-12-18 19:10:04 UTC
Review of attachment 365441 [details] [review]:

Same comment -- I'd like to keep the startup initialization sequence synchronous if possible.
Comment 14 Cosimo Cecchi 2017-12-18 19:10:15 UTC
Review of attachment 365442 [details] [review]:

OK
Comment 15 Cosimo Cecchi 2017-12-18 19:10:28 UTC
Review of attachment 365443 [details] [review]:

Looks good.
Comment 16 Debarshi Ray 2018-06-06 17:43:48 UTC
Created attachment 372579 [details] [review]
application: Tie the catch block more tightly to the failure site

Rebased and pushed to master.
Comment 17 Debarshi Ray 2018-06-06 18:48:45 UTC
Created attachment 372580 [details] [review]
application: Synchronously initialize the getting started PDF
Comment 18 Debarshi Ray 2018-06-06 18:48:59 UTC
Created attachment 372581 [details] [review]
trackerController: Don't submit queries until started
Comment 19 Debarshi Ray 2018-06-06 18:49:14 UTC
Created attachment 372582 [details] [review]
trackerController: Assert against premature queries
Comment 20 Debarshi Ray 2018-06-06 18:49:51 UTC
Created attachment 372583 [details] [review]
application: Insert the getting started PDF only when showing a window
Comment 21 Debarshi Ray 2018-06-06 18:52:09 UTC
Comment on attachment 372581 [details] [review]
trackerController: Don't submit queries until started

Pushed to master.
Comment 22 Debarshi Ray 2018-06-06 18:52:25 UTC
Comment on attachment 372582 [details] [review]
trackerController: Assert against premature queries

Pushed to master.
Comment 23 Debarshi Ray 2018-06-14 09:02:58 UTC
I pushed the remaining patches to master so that I don't forget about them.  They seem to work well in my testing, and I think I addressed all the issues pointed out during the review; but please let me know if something is off.
Comment 24 Cosimo Cecchi 2018-06-15 05:04:33 UTC
Thanks! I took a quick look at the patches and they all look good to me.