GNOME Bugzilla – Bug 781252
Incomplete enumeration after cancelled operation
Last modified: 2017-04-21 07:59:14 UTC
If file cache is not reloaded properly (e.g. because of cancellation), it may lead to various problems (e.g. incomplete enumeration).
Created attachment 349768 [details] [review] google: Do not ignore errors when rebuilding cache If file cache is not loaded properly (e.g. because of cancellation), it may lead to various problems (e.g. incomplete enumeration). Let's return error in such case and rebuild the cache next time...
Rishi, don't you remember whether there isn't any special reason why errors are ignored when rebuilding the cache (if a partial response is already received)?
The idea was to make the code a bit robust against transient network and server errors. If we managed to make initial contact with Google Drive, we'd ignore any following error but stop requesting any further batches. It was based on the approach that gnome-documents uses [1] to keep its local metadata cache updated. But cancellation is an interesting case. :) I didn't think about it. Maybe we can special case (G_IO_ERROR, G_IO_ERROR_CANCELLED) ? I am curious how you reproduced it and what kind of consequences it had. Just trying to understand it. [1] https://git.gnome.org/browse/gnome-online-miners/tree/src/gom-gdata-miner.c#n938
(In reply to Debarshi Ray from comment #3) > The idea was to make the code a bit robust against transient network and > server errors. If we managed to make initial contact with Google Drive, we'd > ignore any following error but stop requesting any further batches. It was > based on the approach that gnome-documents uses [1] to keep its local > metadata cache updated. > > But cancellation is an interesting case. :) I didn't think about it. > > Maybe we can special case (G_IO_ERROR, G_IO_ERROR_CANCELLED) ? I don't think that we want to handle the cancellation differently here. The potential network error has same consequences as the cancellation. Other backends also return some error in the case of network error... > I am curious how you reproduced it and what kind of consequences it had. > Just trying to understand it. 1/ Open Nautilus. 2/ Click on <username>@gmail.com in the sidebar. 3/ Press back button once it is active. (It has to be after the initial batch is received and before the enumeration is done, so you need more than 50 files on your drive at least, it is easy if you have tons of files as me). 4/ Click on <username>@gmail.com in the sidebar again. 5/ Subset of files is shown (until next enumeration after 60 seconds) without any error, which is pretty confusing. (I saw also some weird behavior when doing some operations with the incomplete list, but I don't recall what exactly.) > [1] > https://git.gnome.org/browse/gnome-online-miners/tree/src/gom-gdata-miner. > c#n938 Will look...
(In reply to Ondrej Holy from comment #4) > I don't think that we want to handle the cancellation differently here. The > potential network error has same consequences as the cancellation. Other > backends also return some error in the case of network error... Ok, if other backends don't try to recover from network errors, then I guess the Drive backend need not do it either. I don't have any strong opinion about it. Up to you - whatever you think is best.
Thanks for your comment. I think it is better to let users manually refresh directory after the error, than silently ignore the errors and show just a subset of files (even when reloading)...
Attachment 349768 [details] pushed as be643b7 - google: Do not ignore errors when rebuilding cache