Bug 248719

Summary: Files written to OPFS through a sync access handle in Safari are read back out with a size of zero bytes
Product: WebKit Reporter: Nathan <nathan>
Component: Website StorageAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Major CC: ap, cdumez, sihui_liu, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari 16   
Hardware: Mac (Apple Silicon)   
OS: macOS 13   

Description Nathan 2022-12-03 12:55:56 PST
After closing the sync access handle, reading a file from OPFS with `getFile()` always returns a `File` of size zero.

I've create a gist with file to reproduce the problem. The example in the gist works in Chrome, the file contents can be read back out after the sync access handle is closed.

See https://gist.github.com/myobie/021fc07f09e013b1e5c137ec09282aeb
Comment 1 Radar WebKit Bug Importer 2022-12-10 12:56:15 PST
<rdar://problem/103216871>
Comment 2 Nathan 2023-06-22 10:52:09 PDT
I've just re-tested this on Safari 16.5 and the sync OPFS calls work, files can be read back from the fs. Thanks for fixing this bug 💪