Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ function change(
operation: `insert` | `update` | `delete`,
value: Partial<Item>,
): Message<Item> {
return { key: String(value.id), value: value, headers: { operation } }
return { key: String(value.id), value: value as Item, headers: { operation } }
}

function fixture(
Expand Down Expand Up @@ -307,7 +307,7 @@ function fixture(
$collectionId: _collectionId,
...value
} = row
return structuredClone(value)
return structuredClone(value) as Item
}).sort((a, b) => a.id - b.id)
const durableRows = () =>
structuredClone([...rows.values()].sort((a, b) => a.id - b.id))
Expand Down
2 changes: 2 additions & 0 deletions packages/query-db-collection/src/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -803,6 +803,7 @@ export function queryCollectionOptions(

// Validate required parameters

// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
if (!queryKey) {
throw new QueryKeyRequiredError()
}
Expand All @@ -812,6 +813,7 @@ export function queryCollectionOptions(
throw new QueryFnRequiredError()
}

// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
if (!queryClient) {
throw new QueryClientRequiredError()
}
Expand Down
2 changes: 1 addition & 1 deletion packages/query-db-collection/tests/query.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3652,7 +3652,7 @@ describe(`QueryCollection`, () => {

// A Query Core `removed` event can arrive before this collection's observer
// is detached. Existing semantics retain the active rows and observer.
queryClient.getQueryCache().remove(subsetQuery)
queryClient.getQueryCache().remove(subsetQuery!)
expect(queryClient.getQueryCache().findAll({ queryKey })).toHaveLength(
0,
)
Expand Down
4 changes: 2 additions & 2 deletions packages/trailbase-db-collection/src/trailbase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ export function trailBaseCollectionOptions<
for (let i = 0; i < Math.min(length, remaining); ++i) {
write({
type: `insert`,
value: parse(response.records[i]),
value: parse(response.records[i]!),
})
}

Expand All @@ -287,7 +287,7 @@ export function trailBaseCollectionOptions<
(opts.subscription === undefined || lastKey !== undefined)
) {
cursors.set(
getKey(parse(response.records.at(-1))),
getKey(parse(response.records.at(-1)!)),
response.cursor,
)
}
Expand Down
Loading