-
Notifications
You must be signed in to change notification settings - Fork 624
Index-Free (1/6): Adding LocalStoreTestHelper for NO_CHANGE event #614
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
Conversation
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.
All the instances you've replaced are WatchTargetChangeType.Current
not WatchTargetChangeType.NoChange
. This doesn't seem right.
* `TargetMetadataProvider` callbacks. Any target accessed via these callbacks must be registered | ||
* beforehand via `setSyncedKeys()`. | ||
*/ | ||
public static class TestTargetMetadataProvider |
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.
Consider making this just a top-level class (i.e. in its own source file).
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
@@ -138,36 +138,6 @@ public static QuerySnapshot querySnapshot( | |||
return new QuerySnapshot(query(path), viewSnapshot, FIRESTORE); | |||
} | |||
|
|||
/** |
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.
Thanks for doing this. At some point we should probably cut these down to the minimum, given the assumption there's no reasonable way to share with the main Firestore testutil.
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.
FWIW, only half of the methods are currently used, but it doesn't seem trivial to just put them in the test class (so I refrained from doing this for now).
WatchChangeAggregator aggregator = new WatchChangeAggregator(testTargetMetadataProvider); | ||
|
||
WatchTargetChange watchChange = | ||
new WatchTargetChange(WatchTargetChangeType.Current, asList(targetId), resumeToken); |
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 is a current change, not a no-change. Why are these are substitutable?
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.
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.
LGTM
This is the first of 6 PRs for "index-free" querying.
This PR just adds a test helper to send a resume token (for LocalStoreTest). As part of this, I had to move TestTargetMetadataProvider to a different TestUtil.java (on a related note, we have too many of those...)