aboutsummaryrefslogtreecommitdiff
path: root/ext/wasm/api
diff options
context:
space:
mode:
authorstephan <stephan@noemail.net>2024-10-17 11:12:57 +0000
committerstephan <stephan@noemail.net>2024-10-17 11:12:57 +0000
commit6031de92c6e06e014323cab81e4c0ac77123fa27 (patch)
tree457d3483d7f3f557b872d6a94545989fad37cb52 /ext/wasm/api
parent88282af521692b398b0d0cc58a8bdb220a8ff58c (diff)
downloadsqlite-6031de92c6e06e014323cab81e4c0ac77123fa27.tar.gz
sqlite-6031de92c6e06e014323cab81e4c0ac77123fa27.zip
When calling OpfsSAHPoolUtil.removeVfs(), ensure that the cached result the VFS init is also removed so that the VFS may later be registered again with the same name. Set up test code for the regression reported in [forum:cf37d5ff11 | forum post cf37d5ff11] (which uncovered the removeVfs() shortcoming) but that test is currently only known to fail with the "opfs" VFS and is not currently set up to fail.
FossilOrigin-Name: b7f7a5deeae61920dbfec7606cf9014de711f959a285b29e12673abfd2f88646
Diffstat (limited to 'ext/wasm/api')
-rw-r--r--ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js b/ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js
index d423bb0bb..6551b5c89 100644
--- a/ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js
+++ b/ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js
@@ -57,7 +57,7 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
'use strict';
const toss = sqlite3.util.toss;
const toss3 = sqlite3.util.toss3;
- const initPromises = Object.create(null);
+ const initPromises = Object.create(null) /* cache of (name:result) of VFS init results */;
const capi = sqlite3.capi;
const util = sqlite3.util;
const wasm = sqlite3.wasm;
@@ -843,6 +843,7 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
if(!this.#cVfs.pointer || !this.#dhOpaque) return false;
capi.sqlite3_vfs_unregister(this.#cVfs.pointer);
this.#cVfs.dispose();
+ delete initPromises[this.vfsName];
try{
this.releaseAccessHandles();
await this.#dhVfsRoot.removeEntry(OPAQUE_DIR_NAME, {recursive: true});