Skip to content

Commit b19e907

Browse files
Marcus PousetteMarcus Pousette
authored andcommitted
test(postgres): run live local-write coverage
1 parent 482085b commit b19e907

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ jobs:
204204
env:
205205
TREECRDT_POSTGRES_URL: postgresql://postgres:postgres@127.0.0.1:5432/treecrdt
206206
run: |
207+
cargo test -p treecrdt-postgres --all-targets
207208
pnpm -C packages/treecrdt-postgres-napi test
208209
pnpm -C packages/sync-protocol/material/postgres test
209210
pnpm -C packages/sync-protocol/server/postgres-node test

packages/treecrdt-postgres-rs/src/local_ops.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,9 @@ where
282282
{
283283
begin_tx(client)?;
284284
let result = (|| {
285+
// A local write may be the first operation for a document. Create its revision row inside
286+
// this same transaction before materialization takes the row lock.
287+
ensure_doc_meta(client, doc_id)?;
285288
let mut session = begin_local_core_op(client, doc_id, replica)?;
286289
let prepared = build(&mut session.crdt)?;
287290
let (op, plan) = session.crdt.commit_prepared_local(prepared)?;

0 commit comments

Comments
 (0)