-
Notifications
You must be signed in to change notification settings - Fork 945
Add IndexManager CRUD operations #5970
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
|
cef59a7
to
f18792a
Compare
Size Report 1Affected Products
Test Logs |
Size Analysis Report 1This report is too large (445,136 characters) to be displayed here in a GitHub comment. Please use the below link to see the full report on Google Cloud Storage.Test Logs |
Changeset File Check ✅
|
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.
Sorry for the delay.
@@ -708,13 +708,20 @@ export class DbIndexConfiguration { | |||
|
|||
static keyPath = 'indexId'; | |||
|
|||
static collectionGroupIndex = 'collectionGroupIndex'; |
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 does not exist in Android?
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.
I see why now. Please add comment like you did below.
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
* An index that provides access to documents in a collection sorted by last | ||
* update time. Used by the backfiller. | ||
* | ||
* PORTING NOTE: iOS and Android maintain this index in-memory. |
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.
Maybe also explain why JS is different here?
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
|
||
setIndexManager(indexManager: IndexManager): void { | ||
this.indexManager = indexManager; | ||
} |
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.
Empty line after here?
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
IDBKeyRange.bound(collectionGroup, collectionGroup) | ||
) | ||
: indexes.loadAll() | ||
).next(indexEntries => { |
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.
indexEntry
has different meaning..maybe indexConfig
?
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.
Makes sense. Done.
|
||
let fieldIndexes = await indexManager.getFieldIndexes(); | ||
expect(fieldIndexes[0].indexState).to.deep.equal( | ||
new IndexState(0, IndexOffset.min()) |
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.
Perhaps explain what 0 and 1 means here.
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
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 the review
IDBKeyRange.bound(collectionGroup, collectionGroup) | ||
) | ||
: indexes.loadAll() | ||
).next(indexEntries => { |
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.
Makes sense. Done.
|
||
setIndexManager(indexManager: IndexManager): void { | ||
this.indexManager = indexManager; | ||
} |
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
@@ -708,13 +708,20 @@ export class DbIndexConfiguration { | |||
|
|||
static keyPath = 'indexId'; | |||
|
|||
static collectionGroupIndex = 'collectionGroupIndex'; |
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
* An index that provides access to documents in a collection sorted by last | ||
* update time. Used by the backfiller. | ||
* | ||
* PORTING NOTE: iOS and Android maintain this index in-memory. |
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
|
||
let fieldIndexes = await indexManager.getFieldIndexes(); | ||
expect(fieldIndexes[0].indexState).to.deep.equal( | ||
new IndexState(0, IndexOffset.min()) |
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
Ports the IndexManager from Android. Web doesn't have in-memory backing b/c of Multi-Tab. Some of the tests are not present on Android (yet).