Skip to content

Add SimpleQueryEngine #2160

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

Merged

Conversation

@schmidt-sebastian schmidt-sebastian changed the base branch from master to mrschmidt/indexfree-master September 6, 2019 18:35
@schmidt-sebastian schmidt-sebastian changed the title Mrschmidt/simplequeryengine Add SimpleQueryEngine Sep 6, 2019
Copy link
Contributor

@mikelehen mikelehen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with a couple questions.

@@ -175,6 +177,7 @@ export class LocalStore {
this.mutationQueue,
this.persistence.getIndexManager()
);
this.queryEngine.setLocalDocumentsView(this.localDocuments);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How come we construct the QueryEngine in FirestoreClient and pass it into LocalStore, rather than just construct it here in LocalStore? If we could do that, then we wouldn't need this awkward setLocalDocumentsView() method that must be called before use...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It allows to parameterize the tests for the LocalStore. Fun times.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's tempting to suggest that we just have a useIndexFreeQueryEngine boolean argument or something that tests can use... But I don't care that much.

);

// TODO: Once LocalDocumentsView provides a getCollectionDocuments()
// method, we should call that here and then filter the results.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hrm. What's the context for this TODO (other than the fact that it exists in Android too)? Why do we expect LocalDocumentsView is going to provide a getCollectionDocuments() method in the future?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm. I don't know. I ported it cause it was there an Android. Unfortunately, all traces of who added it are gone by now. I could invest some research and dig this up on Codesearch, but I suspect you would not like the outcome :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ohhh... GRRRR... I forgot about that. I suspect it used to be TODO(indexing) which would imply it doesn't apply to web. So I would prefer if you don't port it. But that means you have to run CI again, so maybe not worth removing (it's friday, YOLO, etc.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll drop it in the next PR.

@schmidt-sebastian
Copy link
Contributor Author

Let me know if you want me to remove the TODO, otherwise I will merge once CI goes green.

@schmidt-sebastian schmidt-sebastian merged commit b3c514a into mrschmidt/indexfree-master Sep 6, 2019
@firebase firebase locked and limited conversation to collaborators Oct 8, 2019
@schmidt-sebastian schmidt-sebastian deleted the mrschmidt/simplequeryengine branch October 10, 2019 22:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants