feat(cloud_firestore): experimental setIndexConfiguration() API#9928
Merged
russellwheatley merged 9 commits intomasterfrom Nov 16, 2022
Merged
feat(cloud_firestore): experimental setIndexConfiguration() API#9928russellwheatley merged 9 commits intomasterfrom
setIndexConfiguration() API#9928russellwheatley merged 9 commits intomasterfrom
Conversation
russellwheatley
commented
Nov 15, 2022
| // Only when back online will this trigger | ||
| controller.add(true); | ||
| }); | ||
| test( |
Member
Author
There was a problem hiding this comment.
I updated this file so that web is skipped for each individual e2e test rather than for the entire file hence why it looks like a lot of changes.
russellwheatley
commented
Nov 15, 2022
| skip: kIsWeb, | ||
| ); | ||
|
|
||
| test('setIndexConfiguration()', () async { |
Member
Author
There was a problem hiding this comment.
This is the integration test for setIndexConfiguration().
Lyokone
reviewed
Nov 15, 2022
| /// The index entries themselves are created asynchronously. You can continue to use queries that | ||
| /// require indexing even if the indices are not yet available. Query execution will automatically | ||
| /// start using the index once the index entries have been written. | ||
| Future<void> setIndexConfiguration({ |
Contributor
There was a problem hiding this comment.
Should we use the experimental flag here?
Member
Author
There was a problem hiding this comment.
Good point, I think we should 👌
Lyokone
approved these changes
Nov 15, 2022
pr-Mais
approved these changes
Nov 16, 2022
setIndexConfiguration() APIsetIndexConfiguration() API
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This feature allows users to set index configurations on cached data when querying offline. This is aimed at improving query speed when offline.
It follows the Cloud Firestore Definition Index set out here.
All platforms expect a JSON string following the above definition. If JSON string is in the incorrect format, it will throw an error.
I have created an index definition file with the relevant classes that correspond to the above definition to make it easy to construct the correct JSON string.
I have updated the inline documentation, but we don't have control over Firestore documentation on the main website. We need to raise this in the next meeting.
Related Issues
See this discussion: #9913
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]).This will ensure a smooth and quick review process. Updating the
pubspec.yamland changelogs is not required.///).melos run analyze) does not report any problems on my PR.Breaking Change
Does your PR require plugin users to manually update their apps to accommodate your change?