Closed achou11 closed 3 days ago
I would just drop the opts.copyToCache
option. It's not being used yet, and it's probably not a great idea in most circumstances. You can add it if needed in the future, although probably in most cases it's going to be better to copy after getting a return value from the document picker, so that you can show better user feedback.
I would just drop the
opts.copyToCache
option. It's not being used yet, and it's probably not a great idea in most circumstances. You can add it if needed in the future, although probably in most cases it's going to be better to copy after getting a return value from the document picker, so that you can show better user feedback.
e.g. always set it to false
and don't expose it as an option for useSelectFile().
I would just drop the
opts.copyToCache
option. It's not being used yet, and it's probably not a great idea in most circumstances. You can add it if needed in the future, although probably in most cases it's going to be better to copy after getting a return value from the document picker, so that you can show better user feedback.
yeah that's valid. had kept it in there because the result of DocumentPicker.getAsync()
provides more useful information if copying to the cache directory, at least based on my memory of how we used it in Mapeo Mobile.
@gmaclennan I implemented your suggestion via b1db178accbe10e08e7ebc9c2c9ffa2536e8603d
The previous approach:
Both steps have a performance overhead that is most noticeable when working with large files. The overhead in (1) is something we've run into before. The issue in (2) is more theoretical, with the suspicion that potentially expensive deletions need to happen internally when moving a file from one storage directory.
This PR changes the approach to the following:
This should have no user-facing impact, aside from potential performance improvements due to doing less work internally.