File tree Expand file tree Collapse file tree
packages/common/src/local-first Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44 isNonEmptyArray ,
55 isNonEmptyReadonlyArray ,
66} from "../Array.js" ;
7- import { assertNonEmptyReadonlyArray } from "../Assert.js" ;
7+ import { assert , assertNonEmptyReadonlyArray } from "../Assert.js" ;
88import { createCallbacks } from "../Callbacks.js" ;
99import { ConsoleDep } from "../Console.js" ;
1010import { RandomBytesDep , SymmetricCryptoDecryptError } from "../Crypto.js" ;
@@ -730,13 +730,18 @@ const createEvoluInstance =
730730 } else {
731731 const { id : _ , isDeleted, ...values } = result . value ;
732732
733- const dbChange = DbChange . orThrow ( {
733+ const dbChange = {
734734 table,
735735 id,
736736 values,
737737 isInsert : kind === "insert" || kind === "upsert" ,
738738 isDelete : SqliteBoolean . is ( isDeleted ) ? Boolean ( isDeleted ) : null ,
739- } ) ;
739+ } ;
740+
741+ assert (
742+ DbChange . is ( dbChange ) ,
743+ `Invalid DbChange for table '${ table } ': Please check schema type errors.` ,
744+ ) ;
740745
741746 mutateMicrotaskQueue . push ( [
742747 { ...dbChange , ownerId : options ?. ownerId } ,
You can’t perform that action at this time.
0 commit comments