does lumenize handle setWebSocketAutoResponse under the hood? couldnt find it mentioned in the docs
does lumenize handle setWebSocketAutoResponse under the hood? couldnt find it mentioned in the docs
Also, a batch might imply some sort of transaction-ish guarantees, which does not exist here.For Lumenize RPC it is transaction-ish. Batches are a single round trip and they all occur sychronously (all are awaited).
Also confirm my understanding that if you do NOT await them, then two writes are held by output gates. The either both succeed or both fail. Is that correct?I did a detailed explanation of this few months ago, but the way I think about it now is simply:
await IO.await IO runs as an implicit transaction.awaiting a non-async storage operation count as awaiting IO? Or would it only count if you were awaiting a true async method call? Or even awaiting the older async kv storage operations. I remember a conversation with Kenton years ago where he indicated that they were special and didn't open output gates.awaiting the old async kv storage operations. It stands to reason they would also do that for the sync storage, but not a given.new_classes to new_sqlite_classes within the 'migrations' field in your wranglerenableSql = true in your workerd config for the class. Note that this change cannot be made after the class is already deployed to production" wrangler dev, those files are in .wrangler folder. If you clear that, you should be good to go.npx vitest runAre you aware that you can use the KV API in a SQL backed DO class?As another user said, you could use the KV API in the new SQLite-backed DOs, although the per DO storage there is not unlimited, it's still 10GB hard limit but there is no account limit, so you would need to a) manually copy the data over, b) shard the data more.
awaitawaitawaitawaitawaitawaitnew_classesnew_sqlite_classesenableSql = trueexport async function setupMiniflare() {
const mf = new Miniflare({
d1Databases: {
USER_PEER_MAPPING: userPeerMappingDatabaseID,
},
scriptPath: "./build/worker/shim.mjs",
modules: true,
modulesRules: [
{ type: "CompiledWasm", include: ["**/*.wasm"], fallthrough: true },
],
durableObjects: {
SYNC_SESSION: "SyncSession",
},
r2Buckets: {
DOCUMENT_SNAPSHOT_BUCKET: "document-snapshot-bucket",
},
kvNamespaces: {
DOCUMENT_VERSIONING_KV: "document-versioning-kv",
SNAPSHOT_STORE_KV: "snapshot-store-kv-test",
},
cachePersist: false,
workflowsPersist: false,
durableObjectsPersist: false,
bindings: {
DOCUMENT_PERMISSIONS_SECRET: "local",
INTERNAL_API_SECRET_KEY: "INTERNAL_API_SECRET",
INTERNAL_API_SECRET,
SPS_API_SECRET_KEY: "local",
SPS_URL:"http://localhost:8090",
local:true,
},
compatibilityDate: '2025-11-17'
});wrangler devnpx vitest run// Note: DOs can set up their own auto-response via this.ctx.setWebSocketAutoResponse()
// in their constructor if needed. We don't set one here to avoid overwriting custom
// auto-responses. RPC clients implement their own heartbeat via setKeepAlive().name = "sql-sync-service"
main = "build/index.js"
compatibility_date = "2025-11-17"
[build]
command = "cargo install -q worker-build && worker-build --release"
[durable_objects]
bindings = [
{ name = "SYNC_SESSION", class_name = "SyncSession" },
]
[[migrations]]
tag = "v1"
new_sqlite_classes = ["SyncSession"]
[observability.logs]
enabled = true
[observability.traces]
enabled = true
head_sampling_rate = 1
persist = true
# DEFAULT ENV -- Used in Local Development & Debugging Remote
[[d1_databases]]
binding = "USER_PEER_MAPPING"
migrations_dir = "./database/user-peer-mapping/migrations/"
database_name = "user-peer-mapping"
database_id = "REDACTED"
[vars]
INTERNAL_API_SECRET_KEY = "LOCAL_API_KEY"
SPS_URL = "https://REDACTED"
[[kv_namespaces]]
binding = "DOCUMENT_VERSIONING_KV"
id = "REDACTED"
[[kv_namespaces]]
binding = "SNAPSHOT_STORE_KV"
id = "REDACTED"