Skip to content

Commit 0f9a299

Browse files
ci: apply automated fixes
1 parent 06cefdc commit 0f9a299

6 files changed

Lines changed: 27 additions & 41 deletions

File tree

‎packages/db/src/query/live/ordered-source-loader.ts‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -489,10 +489,7 @@ export class OrderedSourceLoader {
489489
// Register each request separately. The operation tracker observes the
490490
// next request before this promise settles, so the logical chain remains
491491
// pending without retaining every ancestor promise until the final page.
492-
this.onResult(
493-
tracked,
494-
isFullSource && this.needsFullSourceRecovery,
495-
)
492+
this.onResult(tracked, isFullSource && this.needsFullSourceRecovery)
496493
return tracked
497494
}
498495

‎packages/db/tests/live-query-window-controller.test.ts‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,7 @@ describe(`createLiveQueryWindowController`, () => {
7979
)(
8080
`handles $action during initial loading with $rowCount rows`,
8181
async ({ rowCount, action }) => {
82-
const { source, resolveLoad } = makePendingSource(
83-
ROWS.slice(0, rowCount),
84-
)
82+
const { source, resolveLoad } = makePendingSource(ROWS.slice(0, rowCount))
8583
const lq = makeOrderedLiveQuery(source, 2)
8684
const controller = createLiveQueryWindowController(lq, {
8785
pageSize: 2,

‎packages/db/tests/query/live-query-collection.test.ts‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4092,8 +4092,8 @@ describe(`createLiveQueryCollection`, () => {
40924092
markReady()
40934093

40944094
return {
4095-
loadSubset: (options) => {
4096-
loadSubsetCallCount++
4095+
loadSubset: (options) => {
4096+
loadSubsetCallCount++
40974097
if (!initialPreloadComplete || moveStarted) return true
40984098
moveStarted = true
40994099
return gate.promise.then(() => {
@@ -4112,9 +4112,9 @@ describe(`createLiveQueryCollection`, () => {
41124112
const liveQuery = createLiveQueryCollection({
41134113
query: (q) =>
41144114
q
4115-
.from({ item: sourceCollection })
4116-
.orderBy(({ item }) => item.value, `asc`)
4117-
.limit(1)
4115+
.from({ item: sourceCollection })
4116+
.orderBy(({ item }) => item.value, `asc`)
4117+
.limit(1)
41184118
.offset(0),
41194119
startSync: true,
41204120
})

‎packages/db/tests/query/ordered-source-loader.test.ts‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -247,10 +247,7 @@ describe(`OrderedSourceLoader`, () => {
247247
`settles a fully synchronous $route acquisition before start returns`,
248248
(route) => {
249249
const requests: Array<string> = []
250-
const request = (
251-
method: string,
252-
options: RequestOptions,
253-
): void => {
250+
const request = (method: string, options: RequestOptions): void => {
254251
requests.push(method)
255252
options.onLoadSubsetResult?.(true, options, () => {})
256253
}

‎packages/react-db/src/useLiveQuery.ts‎

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,7 @@ type SuspenseCollectionEntry = {
4747
removeStatusListeners: () => void
4848
}
4949

50-
const unscopedSuspenseCollections = new Map<
51-
string,
52-
SuspenseCollectionEntry
53-
>()
50+
const unscopedSuspenseCollections = new Map<string, SuspenseCollectionEntry>()
5451
const suspenseCollectionsByClient = new WeakMap<
5552
DbClient,
5653
Map<string, SuspenseCollectionEntry>
@@ -197,12 +194,14 @@ function getCurrentTime(): number {
197194
function getWarningCallsite(stackIndex: number): string {
198195
const stack = new Error().stack ?? `unknown`
199196
const lines = stack.split(`\n`)
200-
const userFrame = lines.slice(1).find(
201-
(line) =>
202-
!line.includes(`useLiveQuery.ts`) &&
203-
!line.includes(`useLiveSuspenseQuery.ts`) &&
204-
!line.includes(`useLiveInfiniteQuery.ts`),
205-
)
197+
const userFrame = lines
198+
.slice(1)
199+
.find(
200+
(line) =>
201+
!line.includes(`useLiveQuery.ts`) &&
202+
!line.includes(`useLiveSuspenseQuery.ts`) &&
203+
!line.includes(`useLiveInfiniteQuery.ts`),
204+
)
206205
return userFrame?.trim() ?? lines[stackIndex]?.trim() ?? stack
207206
}
208207

@@ -873,7 +872,8 @@ function useLiveQueryImpl(
873872
const suspenseEntry = suspenseKey
874873
? suspenseCollections?.get(suspenseKey)
875874
: undefined
876-
if (suspenseConsumerId) suspenseEntry?.pendingConsumers.add(suspenseConsumerId)
875+
if (suspenseConsumerId)
876+
suspenseEntry?.pendingConsumers.add(suspenseConsumerId)
877877
const suspenseCollection = suspenseEntry?.collection
878878

879879
const identityChanged =
@@ -936,14 +936,12 @@ function useLiveQueryImpl(
936936
) as SuspenseCollection
937937
if (suspenseCollections && suspenseKey && suspenseConsumerId) {
938938
const collection = collectionRef.current
939-
const removeCleanupListener = collection.on(
940-
`status:cleaned-up`,
941-
() =>
942-
releaseSuspenseCollection(
943-
suspenseCollections,
944-
suspenseKey,
945-
collection,
946-
),
939+
const removeCleanupListener = collection.on(`status:cleaned-up`, () =>
940+
releaseSuspenseCollection(
941+
suspenseCollections,
942+
suspenseKey,
943+
collection,
944+
),
947945
)
948946
const removeErrorListener = collection.on(`status:error`, () => {
949947
// Keep the failed collection through React's immediate retry so

‎packages/react-db/tests/useLiveQuery.uncommitted-render.test.tsx‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -226,9 +226,7 @@ describe(`live queries across uncommitted renders`, () => {
226226
const People = () => {
227227
const { data } = useLiveSuspenseQuery({
228228
query: (q) =>
229-
q
230-
.from({ person: source })
231-
.where(({ person }) => eq(person.id, `1`)),
229+
q.from({ person: source }).where(({ person }) => eq(person.id, `1`)),
232230
})
233231
return <div>{data.map((person) => person.name).join(`, `)}</div>
234232
}
@@ -291,9 +289,7 @@ describe(`live queries across uncommitted renders`, () => {
291289
collections.push(source)
292290
const config = {
293291
query: (q: InitialQueryBuilder) =>
294-
q
295-
.from({ person: source })
296-
.where(({ person }) => eq(person.id, `1`)),
292+
q.from({ person: source }).where(({ person }) => eq(person.id, `1`)),
297293
}
298294
const First = () => {
299295
const { data } = useLiveSuspenseQuery(config)

0 commit comments

Comments
 (0)