Skip to content

Commit d9b2014

Browse files
committed
wip
1 parent 85f51e9 commit d9b2014

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/db/src/query/live/collection-config-builder.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,9 @@ export class CollectionConfigBuilder<
260260
this.inputsCache[alias] = this.graphCache.newInput<any>()
261261
}
262262

263+
// Note: Using fresh WeakMaps here loses cached subquery results, but ensures
264+
// clean compilation with the new alias inputs. For complex queries with many
265+
// subqueries, this could be optimized to preserve the cache.
263266
compilation = compileQuery(
264267
this.query,
265268
this.inputsCache as Record<string, KeyedStream>,
@@ -416,6 +419,8 @@ export class CollectionConfigBuilder<
416419

417420
const subscription = collectionSubscriber.subscribe()
418421
this.subscriptions[alias] = subscription
422+
// Also store under collection key for backward compatibility with join logic
423+
// that may reference collection-level subscriptions
419424
const collectionKey = `__collection:${collectionId}`
420425
this.subscriptions[collectionKey] = subscription
421426

0 commit comments

Comments
 (0)