@@ -51,7 +51,11 @@ import { ensureFirestoreConfigured, Firestore } from './database';
5151import { Pipeline } from './pipeline' ; // Keep this specific Pipeline import if needed alongside LitePipeline
5252import { RealtimePipeline } from './realtime_pipeline' ;
5353import { DocumentReference } from './reference' ;
54- import { SnapshotListenOptions , Unsubscribe } from './reference_impl' ;
54+ import {
55+ PipelineListenOptions ,
56+ SnapshotListenOptions ,
57+ Unsubscribe
58+ } from './reference_impl' ;
5559import { RealtimePipelineSnapshot } from './snapshot' ;
5660import { ExpUserDataWriter } from './user_data_writer' ;
5761
@@ -215,7 +219,7 @@ export function _onRealtimePipelineSnapshot(
215219 */
216220export function _onRealtimePipelineSnapshot (
217221 pipeline : RealtimePipeline ,
218- options : SnapshotListenOptions ,
222+ options : PipelineListenOptions ,
219223 observer : {
220224 next ?: ( snapshot : RealtimePipelineSnapshot ) => void ;
221225 error ?: ( error : FirestoreError ) => void ;
@@ -238,7 +242,7 @@ export function _onRealtimePipelineSnapshot(
238242 */
239243export function _onRealtimePipelineSnapshot (
240244 pipeline : RealtimePipeline ,
241- options : SnapshotListenOptions ,
245+ options : PipelineListenOptions ,
242246 onNext : ( snapshot : RealtimePipelineSnapshot ) => void ,
243247 onError ?: ( error : FirestoreError ) => void ,
244248 onComplete ?: ( ) => void
@@ -247,9 +251,10 @@ export function _onRealtimePipelineSnapshot(
247251 pipeline : RealtimePipeline ,
248252 ...args : unknown [ ]
249253) : Unsubscribe {
250- let options : SnapshotListenOptions = {
254+ let options : PipelineListenOptions = {
251255 includeMetadataChanges : false ,
252- source : 'default'
256+ source : 'default' ,
257+ serverTimestampBehavior : 'none'
253258 } ;
254259 let currArg = 0 ;
255260 if ( typeof args [ currArg ] === 'object' && ! isPartialObserver ( args [ currArg ] ) ) {
@@ -259,7 +264,8 @@ export function _onRealtimePipelineSnapshot(
259264
260265 const internalOptions = {
261266 includeMetadataChanges : options . includeMetadataChanges ,
262- source : options . source as ListenerDataSource
267+ source : options . source as ListenerDataSource ,
268+ serverTimestampBehavior : options . serverTimestampBehavior
263269 } ;
264270
265271 let userObserver : PartialObserver < RealtimePipelineSnapshot > ;
@@ -277,7 +283,9 @@ export function _onRealtimePipelineSnapshot(
277283 const observer = {
278284 next : ( snapshot : ViewSnapshot ) => {
279285 if ( userObserver . next ) {
280- userObserver . next ( new RealtimePipelineSnapshot ( pipeline , snapshot ) ) ;
286+ userObserver . next (
287+ new RealtimePipelineSnapshot ( pipeline , snapshot , internalOptions )
288+ ) ;
281289 }
282290 } ,
283291 error : userObserver . error ,
@@ -286,7 +294,7 @@ export function _onRealtimePipelineSnapshot(
286294
287295 return firestoreClientListen (
288296 client ,
289- toCorePipeline ( pipeline ) ,
297+ toCorePipeline ( pipeline , internalOptions ) ,
290298 internalOptions , // Pass parsed options here
291299 observer
292300 ) ;
0 commit comments