Picking a lot of files with FilePicker is extremely slow on Windows, and can raise access exceptions on iOS #19868
Labels
area-essentials
Essentials: Device, Display, Connectivity, Secure Storage, Sensors, App Info
fixed-in-8.0.70
fixed-in-9.0.0-preview.7.24407.4
platform/iOS 🍎
platform/windows 🪟
t/bug
Something isn't working
t/perf
The issue affects performance (runtime speed, memory usage, startup time, etc.)
Milestone
Description
Ok, first off: I understand this isn't a common use case, but, in my opinion, it should still work. That said, if I use
FilePicker.PickMultipleAsync
to select a plethora of files in a folder (say, 200 - and they can be super tiny text files), I experience the following behavior:Windows: after you click OK, you'll be waiting a very long time for the file results to get returned. Like, close to a minute (even in Release).
iOS: if you try and open one of the returned files, you can get an
UnauthorizedAccessException
. I typically find this happens with about 200 files, though sometimes it's more. In my testing it can be as low as 180. Sometimes 250+. But it will happen if you select enough. If you only select a few, then it works fine. And sidebar: sometimes I swear I tap 'Open' on iOS with files selected, but then it says no files were picked. If I try again it works.I made a repo here that can be used to reproduce the problem: https://github.com/whodges/mauifilepicker.git. I also included a
CreateTestTextFiles
utility method that will make 1000 tiny text files in a specified folder that you can subsequently select via theFilePicker
when the app is run. I created them on Windows, then moved them to my MacBook and subsequently to my iPhone (which is an iPhone 14 Pro, btw).Steps to Reproduce
MainPage.OnOpenClickedAsync
I have call toCreateTestTextFiles
that's commented out; uncomment it for your first run (updatingTestTextFileFolder
to whatever you want it to be) to make a bunch of tiny files to select viaFilePicker
.UnauthorizedAccessException
.Link to public reproduction project repository
https://github.com/whodges/mauifilepicker.git
Version with bug
8.0.5
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
iOS, Windows
Affected platform versions
iOS 17.1.2, Windows 10.0.1.19045
Did you find any workaround?
Nope.
Relevant log output
No response
The text was updated successfully, but these errors were encountered: