File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
packages/db/src/query/live Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -260,6 +260,9 @@ export class CollectionConfigBuilder<
260
260
this . inputsCache [ alias ] = this . graphCache . newInput < any > ( )
261
261
}
262
262
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.
263
266
compilation = compileQuery (
264
267
this . query ,
265
268
this . inputsCache as Record < string , KeyedStream > ,
@@ -416,6 +419,8 @@ export class CollectionConfigBuilder<
416
419
417
420
const subscription = collectionSubscriber . subscribe ( )
418
421
this . subscriptions [ alias ] = subscription
422
+ // Also store under collection key for backward compatibility with join logic
423
+ // that may reference collection-level subscriptions
419
424
const collectionKey = `__collection:${ collectionId } `
420
425
this . subscriptions [ collectionKey ] = subscription
421
426
You can’t perform that action at this time.
0 commit comments