From 1d7612889ec5ecfe76178b44b323fd3934622102 Mon Sep 17 00:00:00 2001 From: Jared Pereira Date: Wed, 27 Aug 2025 17:52:32 +0900 Subject: [PATCH] don't use subtransaction for fact insertions --- src/replicache/cachedServerMutationContext.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/replicache/cachedServerMutationContext.ts b/src/replicache/cachedServerMutationContext.ts index f547efc9..52f9a1ab 100644 --- a/src/replicache/cachedServerMutationContext.ts +++ b/src/replicache/cachedServerMutationContext.ts @@ -193,8 +193,8 @@ export function cachedServerMutationContext( } } - await tx.transaction((tx2) => - tx2 + try { + await tx .insert(facts) .values({ id: f.id, @@ -205,11 +205,10 @@ export function cachedServerMutationContext( .onConflictDoUpdate({ target: facts.id, set: { data: driz.sql`excluded.data` }, - }) - .catch((e) => - console.log(`error on inserting fact: `, JSON.stringify(e)), - ), - ); + }); + } catch (e) { + console.log(`error on inserting fact: `, JSON.stringify(e)); + } } } if (deleteEntitiesCache.length > 0) -- 2.54.0