You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix IDBFS not auto-persisting on directory creation
FS.mkdir does not use mkdir under the hood but rather mknod. The patched
version of mknod installed by IDBFS only invokes IDBFS.queuePersist()
when the node's stream is closed, which never happens for mkdir as the
handle is immediately discarded and no stream is ever created.
Furthermore, the bare fact of file/directory creation should be
persisted even if no writes are made to the node.
The test doesn't catch this because reconcilation happens in a
JavaScript task, and no tasks or microtasks can execute while code is
executing. IDBFS.syncfs only has a chance to run after the entirety of
the test function finishes executing, at which point all of
file/directory operations have been executed and persisted in memory. As
long as one of those operations calls IDBFS.queuePersist, it ensures
that the whole memory filesystem will get persisted to IDB and therefore
shadows missing calls to IDBFS.queuePersist in other operations.
Remove the mkdir node op patching (which has never been a real node op)
and make mknod queue a persist operation as soon as the node is created
without waiting for the caller to interact with a stream.
0 commit comments