-
Notifications
You must be signed in to change notification settings - Fork 940
[3/4] Integrate realtime ppl into SDK cache management and tests #8910
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: wuandy/RealPpl_2
Are you sure you want to change the base?
Conversation
|
Vertex AI Mock Responses Check
|
6710057
to
0c570ab
Compare
33caa24
to
5065573
Compare
*/ | ||
export function _onRealtimePipelineSnapshot( | ||
pipeline: RealtimePipeline, | ||
options: SnapshotListenOptions, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our design doc was updated to use PipelineListenOptions, which will add serverTimestamps
config and remove source
. Though, if we want to support source, we can. go/firestore-api-realtime-pipelines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be refactored in a future PR, as long as we track it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More generally, we will need to put together a design for how pipeline options are passed to onSnapshot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, I forgot about serverTimestamp here. Let's proceed without this for now. I added one item to the tracking sheet.
@@ -691,7 +703,7 @@ export function onSnapshot<AppModelType, DbModelType extends DocumentData>( | |||
|
|||
let observer: PartialObserver<ViewSnapshot>; | |||
let firestore: Firestore; | |||
let internalQuery: InternalQuery; | |||
let internalQuery: QueryOrPipeline; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This type can be reverted back, since we have separated the implementations of listeners for pipelines and query
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
export function onPipelineSnapshot< | ||
AppModelType, | ||
DbModelType extends DocumentData | ||
>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to drop generics from this new api
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
return this.retrieveMatchingLocalDocuments( | ||
overlays, | ||
remoteDocuments, | ||
doc => pipelineMatches(pipeline, doc as MutableDocument) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It isn't clear to me, but do we remove offsets and limits from the pipeline
argument? If not, could those cause false negatives?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do not support offset in offline eval.
Limit will work as intended here, all docs matching the pipeline without limit will return, and limit will be applied later at view layer.
We had discussion on whether we should move that logic into here, but no action had been taken so far.
queryCollectionGroup(query), | ||
documents | ||
); | ||
// TODO(pipeline): this needs to be adapted to support pipelines as well |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reminder on this TODO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed.
0c570ab
to
6f0e635
Compare
5065573
to
5cb4499
Compare
6f0e635
to
58cfd1d
Compare
5cb4499
to
90b6e29
Compare
5cbd519
to
d1b4016
Compare
No description provided.