New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 854521 link

Starred by 2 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 1
Type: Bug

Blocking:
issue 892576



Sign in to add a comment

fileManagerPrivate.addFileWatch() does not notify the specific changed file(s)

Project Member Reported by shenghao@chromium.org, Jun 20 2018

Issue description

Chrome Version: 69 ToT
Chrome OS Version: 69 ToT

We discovered that fileManagerPrivate.addFileWatch() does not notify the specific changed file(s) when we tried to add/delete a file under Downloads/. Specifically, it does not enter the if clause but enter the else clause (https://cs.chromium.org/chromium/src/ui/file_manager/file_manager/foreground/js/directory_model.js?type=cs&q=watcher-directory-changed+file:js&sq=package:chromium&g=0&l=284), which requires the camera app to re-scan the whole folder.

Since file changes in Downloads/ are very frequent, it would cost a lot of overhead to re-scan the folder every time. Could we prioritize a fix in M69?



 
Status: Untriaged (was: Unconfirmed)
Labels: CrOSFilesFeature-FileSystemProvider
Owner: sashab@chromium.org
Status: Assigned (was: Untriaged)
Assigning to Sasha as the P.O.C. for the camera integration. 
Friendly ping.

Comment 4 by sashab@chromium.org, Jun 26 2018

Sorry, I've been on vacation :)

Let me take a look at this today.
Labels: -Pri-2 Pri-1
Sorry. I didn't set the priority correctly.

Comment 6 by sashab@chromium.org, Jun 27 2018

Cc: weifangsun@chromium.org
Hi Sheng-Hao,

Thanks for flagging this.

With more investigation, I don't think we actually support adding per-file watchers in the Files app. We originally wanted this functionality for Recents, but in this case we scan at a timed interval to check for File changes. You my have to implement something similar for M69, and we can look into this again for M70+.

Sasha
Hi Sasha,
We are not requesting for per-file watchers. We want to use the existing addFileWatch() for a directory. The problem is that it does not enter the if clause but enter the else clause (https://cs.chromium.org/chromium/src/ui/file_manager/file_manager/foreground/js/directory_model.js?type=cs&q=watcher-directory-changed+file:js&sq=package:chromium&g=0&l=284), which does not provide the specific changed files in callback.

Could this be possibly addressed in M69?

Comment 8 by sashab@chromium.org, Jun 28 2018

To quote mtomasz@ from the e-mail thread:

"IIRC we only pass list of changed entries for Drive and FSP providers which support it. For Downloads we only know that something in the directory has changed. Maybe this is something which can be fixed, as according to [1] inotify should be able to provide us a list of changes. We use inotify for local files, including Downloads."

[1] https://docs.google.com/document/d/1XNdO-oKq86NqDdlu4z94yx9OVwDFO0AsQAsUDGg25B0/edit#heading=h.2fupsrf8lwh6

AFAIK, all the infrustructure/APIs are already there, we'd just need to plumb it through. But the hard part might be investigating why this hasn't been done already for e.g. performance reasons?

Sorry, but I'd say out of scope for M69. Can you still get the functionality you need for Camera app without it?
Labels: -Pri-1 Pri-2
Moving to P2 for M69.
Labels: -M-69 M-70
Owner: ----
Status: Available (was: Assigned)
Labels: -Pri-2 -M-70 M-71 Pri-1
Labels: -M-71 M-73
Blocking: 892576

Sign in to add a comment