New issue
Advanced search Search tips

Issue 904628 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug



Sign in to add a comment

File picker reads all files in a directory, not just the one picked

Reported by jack...@microsoft.com, Nov 13

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0 Safari/605.1.15

Example URL:
Any (requires a file picker)

Steps to reproduce the problem:
This problem is related to OneDrive Files on Demand for Mac and other similar HSM solutions. Repro steps are:

1. Install MacOS Mojave and OneDrive Files on Demand for Mac (https://aka.ms/filesondemandmac)
2. Set up OneDrive and ensure you have some files that are online only (blue cloud)
3. Open a Chromium client (Chrome, Microsoft Teams, etc) and navigate to a page that contains a file picker
4. Using the file picker, choose a file from your OneDrive that is marked online only

What is the expected behavior?
Only the file that is picked should be read by Chromium, thus causing OneDrive to download the file.

What went wrong?
Chromium appears to read all files in the directory alongside the one that was picked. This causes OneDrive to download all of the user's files that are read, which is both a bad user experience and a waste of bandwidth. 

This problem isn't just applicable to OneDrive. Scanning files in this way has a number of adverse effects on the system, including triggering similar behavior from other HSM systems, triggering anti-virus products to unnecessarily scan files, overwriting last access times, and similar. 

We first noticed this with Chrome and Microsoft Teams but it seems to apply to any Chromium app on macOS. 

Does it occur on multiple sites: Yes

Is it a problem with a plugin? No 

Did this work before? No 

Does this work in other browsers? Yes

Chrome version: Microsoft Teams 1.1.00.30453  Channel: n/a
OS Version: OS X 10.14
Flash Version: n/a

I am the technical lead for OneDrive Files on Demand, so feel free to contact with any questions.
 
Labels: Needs-Milestone
Cc: bokan@chromium.org
Hi there, could you provide a link to an example page with a file picker? Is this the built in Chrome file picker? i.e. <input type=file> ?
Labels: Needs-Feedback
This should just be <input type=file>. We've seen anecdotal reports of this from Chrome users, and also from Microsoft Teams which is an Electron app that uses Chromium and IIRC they use this type of control. 
Project Member

Comment 5 by sheriffbot@chromium.org, Nov 15

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding the requester to the cc list.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Components: -Blink Blink>Forms>File
Labels: Needs-Feedback
Does this issue happen with Firefox and Safari?
Does this issue happen if you drag a file into <input type=file> without triggering a file chooser dialog?

Just tried these with a simple HTML doc that had <input type=file>:

Clicking on "Choose File" and simply viewing the OneDrive folder in the open panel causes hydration in:

 - Chrome
 - Firefox

But not Safari. Safari works correctly.

Dragging the file from the OneDrive folder onto the file picker control does hydrate the file in Chrome, but not the rest of the files in the folder, so that's working correctly. 

Let me know if you have more questions.
Project Member

Comment 9 by sheriffbot@chromium.org, Nov 16

Cc: tkent@chromium.org
Labels: -Needs-Feedback
Thank you for providing more feedback. Adding the requester to the cc list.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Labels: Needs-Feedback
Reporter, thank you for the information.  I'd like to know more information.

When does OneDrive Files on Demand detect unexpected file access?  Just after opening a file chooser dialog, just after closing the file chooser dialog, or on submitting the form with a file control?

What operation triggers download by OneDrive Files on Demand?  Opening a file (such as fopen()), or getting a file metadata (such as fstat())?

> When does OneDrive Files on Demand detect unexpected file access?  Just after opening a file chooser dialog, just after closing the file chooser dialog, or on submitting the form with a file control?

While the dialog is open. If you leave the file chooser open for long enough, you'll eventually trigger all online-only files to download.

> What operation triggers download by OneDrive Files on Demand?  Opening a file (such as fopen()), or getting a file metadata (such as fstat())?

Opening a readable or writable handle on the file, so something like fopen() but other APIs can also have this as a side effect (think something like [NSFileManager contentsAtPath]). APIs like fstat() and friends that only look at the file's metadata won't trigger a download.
Project Member

Comment 12 by sheriffbot@chromium.org, Nov 19

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding the requester to the cc list.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Owner: karandeepb@chromium.org
Status: Assigned (was: Unconfirmed)
ok, I guess something in ui::SelectFileDialogImpl::SetAccessoryView() [1] triggers downloading.  karandeepb@, can you take a look at this?


[1] https://cs.chromium.org/chromium/src/ui/shell_dialogs/select_file_dialog_mac.mm?type=cs&q=SelectFileDialogImpl::SetAccessoryView&sq=package:chromium&g=0&l=293

Owner: ellyjo...@chromium.org
I haven't worked on Mac in a while. Elly can you help triage this.
Labels: -Needs-Milestone Target-73 M-73
Owner: sdy@chromium.org
Mac triage: to sdy@ for M73.

Sign in to add a comment