File tree Expand file tree Collapse file tree 4 files changed +8
-8
lines changed
plugin-firestore-admin/src/actions
plugin-firestore/src/actions
test-utils/src/PluginRemoteMock Expand file tree Collapse file tree 4 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ export function handleStreamPerStore(
3737 if ( isPromise ( foundStream ) ) {
3838 // If onFirstData is provided and stream is already open, call it with existingStream flag
3939 if ( payload ?. onFirstData ) {
40- payload . onFirstData ( { empty : undefined , existingStream : true } )
40+ setTimeout ( ( ) => payload . onFirstData ( { empty : undefined , existingStream : true } ) , 0 )
4141 }
4242 return foundStream
4343 }
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ export function streamActionFactory(
5050 // Call onFirstData on first snapshot (whether doc exists or not)
5151 if ( ! firstDataReceived && onFirstData ) {
5252 firstDataReceived = true
53- onFirstData ( { empty : ! docSnapshot . exists } )
53+ setTimeout ( ( ) => onFirstData ( { empty : ! docSnapshot . exists } ) , 0 )
5454 }
5555
5656 // do nothing if the doc doesn't exist
@@ -74,7 +74,7 @@ export function streamActionFactory(
7474 // Call onFirstData on first snapshot (whether collection has docs or not)
7575 if ( ! firstDataReceived && onFirstData ) {
7676 firstDataReceived = true
77- onFirstData ( { empty : querySnapshot . empty } )
77+ setTimeout ( ( ) => onFirstData ( { empty : querySnapshot . empty } ) , 0 )
7878 }
7979
8080 // serverChanges only
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ export function streamActionFactory(
5656 ! docSnapshot . metadata . hasPendingWrites
5757 ) {
5858 firstDataReceived = true
59- onFirstData ( { empty : ! docSnapshot . exists ( ) } )
59+ setTimeout ( ( ) => onFirstData ( { empty : ! docSnapshot . exists ( ) } ) , 0 )
6060 }
6161
6262 // do nothing if the doc doesn't exist
@@ -88,7 +88,7 @@ export function streamActionFactory(
8888 ! querySnapshot . metadata . hasPendingWrites
8989 ) {
9090 firstDataReceived = true
91- onFirstData ( { empty : querySnapshot . empty } )
91+ setTimeout ( ( ) => onFirstData ( { empty : querySnapshot . empty } ) , 0 )
9292 }
9393
9494 // serverChanges only
Original file line number Diff line number Diff line change @@ -273,7 +273,7 @@ export function streamActionFactory(storePluginOptions: RemoteStoreOptions): Plu
273273 // Call onFirstData on first data processed
274274 if ( ! firstDataProcessed && onFirstData ) {
275275 firstDataProcessed = true
276- onFirstData ( { empty : false } )
276+ setTimeout ( ( ) => onFirstData ( { empty : false } ) , 0 )
277277 }
278278 mustExecuteOnRead . added ( data , metaData )
279279 }
@@ -291,7 +291,7 @@ export function streamActionFactory(storePluginOptions: RemoteStoreOptions): Plu
291291 // Call onFirstData on first data processed
292292 if ( ! firstDataProcessed && onFirstData ) {
293293 firstDataProcessed = true
294- onFirstData ( { empty : false } )
294+ setTimeout ( ( ) => onFirstData ( { empty : false } ) , 0 )
295295 }
296296 mustExecuteOnRead . added ( data , metaData )
297297 }
@@ -304,7 +304,7 @@ export function streamActionFactory(storePluginOptions: RemoteStoreOptions): Plu
304304 setTimeout ( ( ) => {
305305 if ( ! firstDataProcessed ) {
306306 firstDataProcessed = true
307- onFirstData ( { empty : true } )
307+ setTimeout ( ( ) => onFirstData ( { empty : true } ) , 0 )
308308 }
309309 } , 0 )
310310 }
You can’t perform that action at this time.
0 commit comments