Repository navigation
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The localized fixes preserve picker selection, address the reported failures, and include targeted regression coverage with no identified blocking issues.
No open issues 🎉
What changed in this PR
Fixes WebAssembly picker support reporting and Safari download failures for #24130, #25683, and #25684, following the chunked-storage changes in #23880.
Changes:
- Aligns file-picker support checks with the implementation selected by
WasmConfiguration. - Uses in-memory downloads when writable storage is unavailable and copies partial chunks to prevent Safari zero-padding.
- Adds regression tests and updates capability and provider documentation.
| File | Description |
|---|---|
| src/Uno.WinRT/ts/Windows/Storage/Streams/NativeChunkedBuffer.ts | Fixes writable-storage detection and partial-chunk downloads. |
| src/Uno.WinRT/Storage/Pickers/FileSavePicker.wasm.cs | Shares implementation selection with save support checks. |
| src/Uno.WinRT/Storage/Pickers/FileOpenPicker.wasm.cs | Shares implementation selection with open support checks. |
| src/Uno.UI.RuntimeTests/Windows/Storage/Pickers/Given_FileSystemAccessApiInformation.cs | Tests picker support and downloaded content integrity. |
| src/Uno.UI.Runtime.WebAssembly.Browser/Storage/Pickers/FileSystemAccessApiInformation.cs | Reports support for configured native or fallback file pickers. |
| doc/articles/features/windows-storage-pickers.md | Clarifies support semantics, provider IDs, and configuration options. |
Review effort: Balanced
Contributor
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-25685/docs/index.html |
1 of 2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GitHub Issue:
Fixes #24130
Fixes #25683
Fixes #25684
PR Type:
🐞 Bugfix
What changed? 🚀
Saving through
FileSavePickeron WebAssembly had three problems in browsers without the File System Access API, where it falls back to the download picker:IsSavePickerSupportedreportedfalsewhere saving works ([WASM] False negative FileSystemAccessApiInformation.IsSavePickerSupported #24130). It only checked forshowSaveFilePicker, so it wasfalsein Brave, Firefox and Safari although the defaultWasmPickerConfiguration.FileSystemAccessApiWithFallbacksaves there with the download picker.IsOpenPickerSupportedhad the same problem with the upload picker.TypeError: handle.createWritable is not a functionon Safari 15.2 to 18 #25683). The download picker stages the file in the origin-private file system (OPFS) since fix(wasm): Stop buffering whole files in tab memory on StorageFile writes #23880, and only built the download in memory when there was no OPFS. Safari 15.2 to 18 hasnavigator.storage.getDirectory()but noFileSystemFileHandle.createWritable(added in Safari 26), soCachedFileManager.CompleteUpdatesAsyncfailed withTypeError: handle.createWritable is not a function. This is the iOS 16 failure in [WASM] False negative FileSystemAccessApiInformation.IsSavePickerSupported #24130. iOS 17 and 18 failed the same way.byteOffsetandbyteLength(WebKit bug 302733). The staging wrote the last, partial 2 MB chunk assubarray(0, n), so every file was padded with zeros to a multiple of 2 MB: a 16-byte file was saved as 2,097,152 bytes, and a 4,206,649-byte file as 6,291,456 bytes.Fixes
createWritable: the download picker now also builds the download in memory whencreateWritableis missing, as it already did without OPFS. Saving therefore works in Safari 15.2 to 18, andIsSavePickerSupportedistruethere, like in every other browser where saving works. Reportingfalsethere would have meant keeping saving broken on iOS 16 to 18, while the in-memory download, the path browsers without OPFS take, works there.Uint8Arraywith its own buffer, so Safari writes exactly that chunk. The copy isn't limited to Safari: it is correct in every browser, costs at most one copy of the partial last chunk per file, and needs no change once WebKit fixes its bug.IsOpenPickerSupportedandIsSavePickerSupportednow report whether the picker can be used under the currentWasmConfiguration: with the File System Access API when that is enabled and available, or with the upload or download picker when that is enabled. Each picker now chooses its implementation through one helper, which itsIsSupported()uses too, so the two can't drift apart.AreFilePickersSupportedfollows them.IsFolderPickerSupportedis unchanged;FolderPickerhas no other implementation.WasmConfigurationIsSavePickerSupportedbeforetruetruefalsetruefalsetruefalsetrueTypeErroron commitDownloadUploadtrueFileSystemAccessApifalsefalseNotSupportedExceptionNotSupportedExceptionThe docs section that described these properties as File System Access API checks now describes what they report; it keeps its old anchor,
#checking-whether-file-system-access-api-is-supported, for existing links. It also lists the download picker's provider ID next to the other two, sinceStorageFile.Provider.Idis what tells a File System Access API file (jsfileaccessapi) from a download picker file (wasmdownloadpicker). The list ofWasmConfigurationvalues, which was missing the space after each bullet and rendered as plain text, is now a list.Tests
The new
Given_FileSystemAccessApiInformationruntime tests run on Skia WebAssembly only:When_Download_Upload_Pickers_Are_Enabled_Then_File_Pickers_Are_Supported: the three properties, withFileSystemAccessApiWithFallbackand withDownloadUpload(6 rows).When_Only_File_System_Access_Api_Is_Enabled_Then_Support_Follows_The_Browser: withFileSystemAccessApi, the properties followshowOpenFilePickerandshowSaveFilePicker(2 rows).When_Download_Is_Committed_Then_The_Browser_Downloads_The_Content: picks a file with the download picker, writesHello, world!, commits it and checks the download's name and content (2 rows).When_Download_Spans_Several_Chunks_Then_The_Browser_Downloads_All_Of_It: the same with 4,206,649 bytes (two full chunks and a partial one) and with exactly two chunks, checking the download's length and hash (3 rows).The download tests record the download instead of starting it. One row of each hides
createWritable, as in Safari 15.2 to 18.Headless Chrome has the File System Access API pickers, so the support tests only fail without the fix in a browser without them. I ran them in Chrome with
--disable-blink-features=FileSystemAccessLocal, which removes those pickers as Brave does, and in Safari in the iOS simulator. Results, out of 13 tests (SamplesAppbrowserwasm):createWritablefail:TypeError: handle.createWritable is not a functioncreateWritablefailcreateWritable(TypeError) and the two partial-chunk downloads fail (2,097,149 characters instead of 13, and 6,291,456 bytes instead of 4,206,649)All 271
Windows_Storageruntime tests pass with the fix in headless Chrome (270 passed, 1 skipped). I couldn't run Safari 15.2 to 18, since no simulator runtime for those versions is installed here, nor Firefox or Brave itself. HidingcreateWritablein Safari 26 and 27 covers the same code path.PR Checklist ✅
Screenshots Compare Test Runresults.Behavior change:
IsOpenPickerSupported,IsSavePickerSupportedandAreFilePickersSupportedused to report whether the File System Access API pickers are present. Apps that used them that way now gettruein browsers that only have the download and upload pickers. Whether a picked file came from the File System Access API is still given by itsProvider.Id. With theFileSystemAccessApiconfiguration, the properties still report the File System Access API pickers.