-
Couldn't load subscription status.
- Fork 6
Open
Description
I was trying to use encryptWith in combination of atomic batch for setBlob to store medium-sized objects, and it seems that it doesn't work (in addition of failing silently)
Here you see the transaction getting marked as succesful, but when reading back it's actually empty:
[ { ok: true, versionstamp: "00000000000000060000" } ]
{ key: [ "blob" ], value: null, versionstamp: null }
Minimal reproduction
import { generateKey, openKvToolbox } from "jsr:@kitsonk/kv-toolbox";
const kv = await openKvToolbox({ path: ":memory:", encryptWith: generateKey() });
const res = await kv.atomic()
.setBlob(["blob"], new TextEncoder().encode("Hello, world!"))
.commit();
console.log(res);
console.log(await kv.getBlob(["blob"]))Just removing the encryption key makes the same code works:
[ { ok: true, versionstamp: "00000000000000020000" } ]
{
key: [ "blob" ],
value: Uint8Array(13) [
72, 101, 108, 108, 111,
44, 32, 119, 111, 114,
108, 100, 33
],
versionstamp: "00000000000000020000"
}
Metadata
Metadata
Assignees
Labels
No labels