@tanstack/db 0.6.1 → 0.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/db",
3
- "version": "0.6.1",
3
+ "version": "0.6.2",
4
4
  "description": "A reactive client store for building super fast apps on sync",
5
5
  "author": "Kyle Mathews",
6
6
  "license": "MIT",
@@ -302,8 +302,20 @@ function processJoin(
302
302
  return
303
303
  }
304
304
 
305
- // Request filtered snapshot from lazy collection for matching join keys
306
- const joinKeys = data.getInner().map(([[joinKey]]) => joinKey)
305
+ // Deduplicate and filter null keys before requesting snapshot
306
+ const joinKeys = [
307
+ ...new Set(
308
+ data
309
+ .getInner()
310
+ .map(([[joinKey]]) => joinKey)
311
+ .filter((key) => key != null),
312
+ ),
313
+ ]
314
+
315
+ if (joinKeys.length === 0) {
316
+ return
317
+ }
318
+
307
319
  const lazyJoinRef = new PropRef(followRefResult.path)
308
320
  const loaded = lazySourceSubscription.requestSnapshot({
309
321
  where: inArray(lazyJoinRef, joinKeys),
@@ -227,7 +227,8 @@ export class CollectionConfigBuilder<
227
227
  id: this.id,
228
228
  getKey:
229
229
  this.config.getKey ||
230
- ((item) => this.resultKeys.get(item) as string | number),
230
+ ((item: any) =>
231
+ (this.resultKeys.get(item) ?? item.$key) as string | number),
231
232
  sync: this.getSyncConfig(),
232
233
  compare: this.compare,
233
234
  defaultStringCollation: this.compareOptions,
@@ -1515,6 +1516,7 @@ function createChildCollectionEntry(
1515
1516
  },
1516
1517
  },
1517
1518
  startSync: true,
1519
+ gcTime: 0,
1518
1520
  })
1519
1521
 
1520
1522
  const entry: ChildCollectionEntry = {