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 @@ -1779,7 +1779,7 @@ function flushIncludesState(
17791779 entry . collection ,
17801780 entry . collection . id ,
17811781 childChanges ,
1782- null ,
1782+ entry . syncMethods ,
17831783 )
17841784 }
17851785 }
@@ -1793,20 +1793,22 @@ function flushIncludesState(
17931793 entry . collection ,
17941794 entry . collection . id ,
17951795 null ,
1796- null ,
1796+ entry . syncMethods ,
17971797 )
17981798 }
17991799 }
18001800
18011801 // For toArray entries: re-emit affected parents with updated array snapshots
1802+ const toArrayReEmitKeys = state . materializeAsArray
1803+ ? new Set ( [ ...( affectedCorrelationKeys || [ ] ) , ...dirtyFromBuffers ] )
1804+ : null
18021805 if (
1803- state . materializeAsArray &&
18041806 parentSyncMethods &&
1805- affectedCorrelationKeys &&
1806- affectedCorrelationKeys . size > 0
1807+ toArrayReEmitKeys &&
1808+ toArrayReEmitKeys . size > 0
18071809 ) {
18081810 parentSyncMethods . begin ( )
1809- for ( const correlationKey of affectedCorrelationKeys ) {
1811+ for ( const correlationKey of toArrayReEmitKeys ) {
18101812 const parentKeys = state . correlationToParentKeys . get ( correlationKey )
18111813 if ( ! parentKeys ) continue
18121814 const entry = state . childRegistry . get ( correlationKey )
You can’t perform that action at this time.
0 commit comments