Bug 248719 - Files written to OPFS through a sync access handle in Safari are read back out with a size of zero bytes
Summary: Files written to OPFS through a sync access handle in Safari are read back ou...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Website Storage (show other bugs)
Version: Safari 16
Hardware: Mac (Apple Silicon) macOS 13
: P2 Major
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-12-03 12:55 PST by Nathan
Modified: 2023-06-22 10:52 PDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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 💪