Skip to content
This repository has been archived by the owner on May 15, 2024. It is now read-only.

Make UWP FilePicker FutureAccessList more robust #2093

Merged
merged 1 commit into from
Aug 10, 2023
Merged

Make UWP FilePicker FutureAccessList more robust #2093

merged 1 commit into from
Aug 10, 2023

Conversation

jfversluis
Copy link
Member

Description of Change

When using FilePicker on UWP it will add the entries to something that is called the FutureAccessList. However, that list has a maximum amount of entries and when it reaches that, it will break. This change will add some more robustness.

This adds:

  • Check if we're going over the limit with the picked files
  • If yes; clean up the list starting with the oldest entries (assumed)
  • Add the last n number of picked files back to the list, where n is the amount of files picked, or if that exceed the maximum of the FutureAccessList, it will take that maximum.
  • Wraps this whole process in a try/catch so we don't break users apps when something goes wrong, its not that important.

Bugs Fixed

Behavioral Changes

Describe any non-bug related behavioral changes that may change how users app behaves when upgrading to this version of the codebase.

PR Checklist

  • Has tests (if omitted, state reason in description)
  • Has samples (if omitted, state reason in description)
  • Rebased on top of main at time of PR
  • Changes adhere to coding standard
  • Updated documentation (see walkthrough)

@jfversluis
Copy link
Member Author

@DanielGilbert are you still interested in this one? How does this look?

@DanielGilbert
Copy link

@DanielGilbert are you still interested in this one? How does this look?

Hi @jfversluis !

It's an improvement to the existing solution, thanks! Although I still stand by my comment, that a library should never interfere with the list. But it is how it is, I guess. :)

@jfversluis
Copy link
Member Author

@DanielGilbert I totally agree. I guess the problem here is that it has been like this since forever and people might have come to rely on this happening now and so it will be a breaking change to remove it entirely. I think the actual impact will be limited, but better safe than sorry.

Thanks for all your input on this!

@jfversluis jfversluis merged commit d521376 into main Aug 10, 2023
@jfversluis jfversluis deleted the fix-2068 branch August 10, 2023 07:27
@jfversluis jfversluis restored the fix-2068 branch December 6, 2023 14:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] [UWP] App crashes when picking more than 1,000 files
2 participants