diff --git a/crates/dwn-rs-stores/src/surrealdb/data_store.rs b/crates/dwn-rs-stores/src/surrealdb/data_store.rs index f323875..399317c 100644 --- a/crates/dwn-rs-stores/src/surrealdb/data_store.rs +++ b/crates/dwn-rs-stores/src/surrealdb/data_store.rs @@ -38,6 +38,11 @@ impl DataStore for SurrealDB { let len = self .with_database(tenant, |db| async move { + db.delete::>(id.clone()) + .await + .map_err(SurrealDBError::from) + .map_err(StoreError::from)?; + db.create::>(id.clone()) .content(CreateData { cid: cid.to_string(), diff --git a/crates/dwn-rs-wasm/package.json b/crates/dwn-rs-wasm/package.json index ac2ed9c..dfd1142 100644 --- a/crates/dwn-rs-wasm/package.json +++ b/crates/dwn-rs-wasm/package.json @@ -3,7 +3,7 @@ "version": "0.1.0-dev", "type": "module", "dependencies": { - "@tbd54566975/dwn-sdk-js": "0.3.10", + "@tbd54566975/dwn-sdk-js": "0.4.0", "@types/readable-stream": "4.0.14", "readable-stream": "4.5.2" }, diff --git a/crates/dwn-rs-wasm/tests/test.js b/crates/dwn-rs-wasm/tests/test.js index 8821591..665a0d4 100644 --- a/crates/dwn-rs-wasm/tests/test.js +++ b/crates/dwn-rs-wasm/tests/test.js @@ -3,6 +3,7 @@ import { SurrealDataStore, SurrealMessageStore, SurrealEventLog, + SurrealResumableTaskStore, } from "../pkg/index.js"; import WebSocket from "isomorphic-ws"; @@ -15,6 +16,8 @@ let d = new SurrealDataStore(); await d.connect("mem://"); let e = new SurrealEventLog(); await e.connect("mem://"); +let t = new SurrealResumableTaskStore(); +await t.connect("mem://"); describe("Store dependent tests", () => { TestSuite.runInjectableDependentTests({ messageStore: s,