File picker reads all files in a directory, not just the one picked
Reported by
jack...@microsoft.com,
Nov 13
|
||||||||||||
Issue descriptionUserAgent: 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.
,
Nov 13
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> ?
,
Nov 13
,
Nov 15
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.
,
Nov 15
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
,
Nov 15
,
Nov 16
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?
,
Nov 16
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.
,
Nov 16
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
,
Nov 19
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())?
,
Nov 19
> 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.
,
Nov 19
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
,
Nov 20
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
,
Nov 20
I haven't worked on Mac in a while. Elly can you help triage this.
,
Nov 21
Mac triage: to sdy@ for M73. |
||||||||||||
►
Sign in to add a comment |
||||||||||||
Comment 1 by swarnasree.mukkala@chromium.org
, Nov 13