@@ -42,7 +42,11 @@ import { ensureFirestoreConfigured, Firestore } from './database';
4242import { Pipeline } from './pipeline' ; // Keep this specific Pipeline import if needed alongside LitePipeline
4343import { RealtimePipeline } from './realtime_pipeline' ;
4444import { DocumentReference } from './reference' ;
45- import { SnapshotListenOptions , Unsubscribe } from './reference_impl' ;
45+ import {
46+ PipelineListenOptions ,
47+ SnapshotListenOptions ,
48+ Unsubscribe
49+ } from './reference_impl' ;
4650import { RealtimePipelineSnapshot } from './snapshot' ;
4751import { ExpUserDataWriter } from './user_data_writer' ;
4852
@@ -165,7 +169,7 @@ export function _onRealtimePipelineSnapshot(
165169 */
166170export function _onRealtimePipelineSnapshot (
167171 pipeline : RealtimePipeline ,
168- options : SnapshotListenOptions ,
172+ options : PipelineListenOptions ,
169173 observer : {
170174 next ?: ( snapshot : RealtimePipelineSnapshot ) => void ;
171175 error ?: ( error : FirestoreError ) => void ;
@@ -188,7 +192,7 @@ export function _onRealtimePipelineSnapshot(
188192 */
189193export function _onRealtimePipelineSnapshot (
190194 pipeline : RealtimePipeline ,
191- options : SnapshotListenOptions ,
195+ options : PipelineListenOptions ,
192196 onNext : ( snapshot : RealtimePipelineSnapshot ) => void ,
193197 onError ?: ( error : FirestoreError ) => void ,
194198 onComplete ?: ( ) => void
@@ -197,9 +201,10 @@ export function _onRealtimePipelineSnapshot(
197201 pipeline : RealtimePipeline ,
198202 ...args : unknown [ ]
199203) : Unsubscribe {
200- let options : SnapshotListenOptions = {
204+ let options : PipelineListenOptions = {
201205 includeMetadataChanges : false ,
202- source : 'default'
206+ source : 'default' ,
207+ serverTimestampBehavior : 'none'
203208 } ;
204209 let currArg = 0 ;
205210 if ( typeof args [ currArg ] === 'object' && ! isPartialObserver ( args [ currArg ] ) ) {
@@ -209,7 +214,8 @@ export function _onRealtimePipelineSnapshot(
209214
210215 const internalOptions = {
211216 includeMetadataChanges : options . includeMetadataChanges ,
212- source : options . source as ListenerDataSource
217+ source : options . source as ListenerDataSource ,
218+ serverTimestampBehavior : options . serverTimestampBehavior
213219 } ;
214220
215221 let userObserver : PartialObserver < RealtimePipelineSnapshot > ;
@@ -227,7 +233,9 @@ export function _onRealtimePipelineSnapshot(
227233 const observer = {
228234 next : ( snapshot : ViewSnapshot ) => {
229235 if ( userObserver . next ) {
230- userObserver . next ( new RealtimePipelineSnapshot ( pipeline , snapshot ) ) ;
236+ userObserver . next (
237+ new RealtimePipelineSnapshot ( pipeline , snapshot , internalOptions )
238+ ) ;
231239 }
232240 } ,
233241 error : userObserver . error ,
@@ -236,7 +244,7 @@ export function _onRealtimePipelineSnapshot(
236244
237245 return firestoreClientListen (
238246 client ,
239- toCorePipeline ( pipeline ) ,
247+ toCorePipeline ( pipeline , internalOptions ) ,
240248 internalOptions , // Pass parsed options here
241249 observer
242250 ) ;
0 commit comments