@@ -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
@@ -234,7 +238,7 @@ export function _onRealtimePipelineSnapshot(
234238 */
235239export function _onRealtimePipelineSnapshot (
236240 pipeline : RealtimePipeline ,
237- options : SnapshotListenOptions ,
241+ options : PipelineListenOptions ,
238242 observer : {
239243 next ?: ( snapshot : RealtimePipelineSnapshot ) => void ;
240244 error ?: ( error : FirestoreError ) => void ;
@@ -257,7 +261,7 @@ export function _onRealtimePipelineSnapshot(
257261 */
258262export function _onRealtimePipelineSnapshot (
259263 pipeline : RealtimePipeline ,
260- options : SnapshotListenOptions ,
264+ options : PipelineListenOptions ,
261265 onNext : ( snapshot : RealtimePipelineSnapshot ) => void ,
262266 onError ?: ( error : FirestoreError ) => void ,
263267 onComplete ?: ( ) => void
@@ -266,9 +270,10 @@ export function _onRealtimePipelineSnapshot(
266270 pipeline : RealtimePipeline ,
267271 ...args : unknown [ ]
268272) : Unsubscribe {
269- let options : SnapshotListenOptions = {
273+ let options : PipelineListenOptions = {
270274 includeMetadataChanges : false ,
271- source : 'default'
275+ source : 'default' ,
276+ serverTimestampBehavior : 'none'
272277 } ;
273278 let currArg = 0 ;
274279 if ( typeof args [ currArg ] === 'object' && ! isPartialObserver ( args [ currArg ] ) ) {
@@ -278,7 +283,8 @@ export function _onRealtimePipelineSnapshot(
278283
279284 const internalOptions = {
280285 includeMetadataChanges : options . includeMetadataChanges ,
281- source : options . source as ListenerDataSource
286+ source : options . source as ListenerDataSource ,
287+ serverTimestampBehavior : options . serverTimestampBehavior
282288 } ;
283289
284290 let userObserver : PartialObserver < RealtimePipelineSnapshot > ;
@@ -296,7 +302,9 @@ export function _onRealtimePipelineSnapshot(
296302 const observer = {
297303 next : ( snapshot : ViewSnapshot ) => {
298304 if ( userObserver . next ) {
299- userObserver . next ( new RealtimePipelineSnapshot ( pipeline , snapshot ) ) ;
305+ userObserver . next (
306+ new RealtimePipelineSnapshot ( pipeline , snapshot , internalOptions )
307+ ) ;
300308 }
301309 } ,
302310 error : userObserver . error ,
@@ -305,7 +313,7 @@ export function _onRealtimePipelineSnapshot(
305313
306314 return firestoreClientListen (
307315 client ,
308- toCorePipeline ( pipeline ) ,
316+ toCorePipeline ( pipeline , internalOptions ) ,
309317 internalOptions , // Pass parsed options here
310318 observer
311319 ) ;
0 commit comments