Skip to content

Commit 9064e7c

Browse files
committed
Cleanup
1 parent 4ca7a04 commit 9064e7c

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

packages/sdk/src/db_connection_impl.ts

+8-4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
ProductTypeElement,
66
SumType,
77
SumTypeVariant,
8+
type ComparablePrimitive,
89
} from './algebraic_type.ts';
910
import {
1011
AlgebraicValue,
@@ -320,7 +321,7 @@ export class DbConnectionImpl<
320321
while (reader.offset < buffer.length + buffer.byteOffset) {
321322
const initialOffset = reader.offset;
322323
const row = rowType.deserialize(reader);
323-
let rowId: any | undefined = undefined;
324+
let rowId: ComparablePrimitive | undefined = undefined;
324325
if (primaryKeyInfo !== undefined) {
325326
rowId = primaryKeyInfo.colType.intoMapKey(
326327
row[primaryKeyInfo.colName]
@@ -546,10 +547,13 @@ export class DbConnectionImpl<
546547
const tableName = tableUpdate.tableName;
547548
const tableTypeInfo = this.#remoteModule.tables[tableName]!;
548549
const table = this.clientCache.getOrCreateTable(tableTypeInfo);
549-
550-
pendingCallbacks = pendingCallbacks.concat(
551-
table.applyOperations(tableUpdate.operations, eventContext)
550+
const newCallbacks = table.applyOperations(
551+
tableUpdate.operations,
552+
eventContext
552553
);
554+
for (const callback of newCallbacks) {
555+
pendingCallbacks.push(callback);
556+
}
553557
}
554558
return pendingCallbacks;
555559
}

packages/sdk/src/spacetime_module.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import type { DbConnectionImpl } from './db_connection_impl';
44
export interface TableRuntimeTypeInfo {
55
tableName: string;
66
rowType: AlgebraicType;
7-
primaryKeyInfo?: PrimaryKeyInfo | undefined;
7+
primaryKeyInfo?: PrimaryKeyInfo;
88
}
99

1010
export interface PrimaryKeyInfo {

0 commit comments

Comments
 (0)