File tree Expand file tree Collapse file tree
packages/db/src/query/live Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1776,7 +1776,7 @@ function flushIncludesState(
17761776 entry . collection ,
17771777 entry . collection . id ,
17781778 childChanges ,
1779- null ,
1779+ entry . syncMethods ,
17801780 )
17811781 }
17821782 }
@@ -1790,20 +1790,22 @@ function flushIncludesState(
17901790 entry . collection ,
17911791 entry . collection . id ,
17921792 null ,
1793- null ,
1793+ entry . syncMethods ,
17941794 )
17951795 }
17961796 }
17971797
17981798 // For toArray entries: re-emit affected parents with updated array snapshots
1799+ const toArrayReEmitKeys = state . materializeAsArray
1800+ ? new Set ( [ ...( affectedCorrelationKeys || [ ] ) , ...dirtyFromBuffers ] )
1801+ : null
17991802 if (
1800- state . materializeAsArray &&
18011803 parentSyncMethods &&
1802- affectedCorrelationKeys &&
1803- affectedCorrelationKeys . size > 0
1804+ toArrayReEmitKeys &&
1805+ toArrayReEmitKeys . size > 0
18041806 ) {
18051807 parentSyncMethods . begin ( )
1806- for ( const correlationKey of affectedCorrelationKeys ) {
1808+ for ( const correlationKey of toArrayReEmitKeys ) {
18071809 const parentKeys = state . correlationToParentKeys . get ( correlationKey )
18081810 if ( ! parentKeys ) continue
18091811 const entry = state . childRegistry . get ( correlationKey )
You can’t perform that action at this time.
0 commit comments