-
Notifications
You must be signed in to change notification settings - Fork 945
Bundle's named query resume. #3395
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
Changes from 50 commits
9602712
c5e783e
5e7fb89
1ee1615
18f0be1
aa455bf
78248cd
83160a1
24e10cb
9d6edc5
4cbe608
4313e51
296cfc4
fff3d36
fb762de
1ec4182
cd3ab7a
d991c75
af097c5
e735e23
17ba434
f808d8d
db1d864
979ffd9
f7ff495
556a007
adf1504
b364ab0
2588f20
93bc964
cb56334
cd88414
99610d7
a6963dc
d738d9d
9b00a85
23ea4d8
27e0fd8
8147aea
a3d0bb0
48658b4
8baf8fc
7abcf19
f228dfb
5a6e8ea
70d350a
8ea9e7b
487982c
9f1e135
5eb05d9
e057fc1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -973,8 +973,15 @@ export function toTarget( | |
|
||
result.targetId = targetData.targetId; | ||
|
||
// TODO(wuandy): We should consider remove resume token since we can always | ||
// use readtime. | ||
if (targetData.resumeToken.approximateByteSize() > 0) { | ||
result.resumeToken = toBytes(serializer, targetData.resumeToken); | ||
} else if (targetData.snapshotVersion.compareTo(SnapshotVersion.min()) > 0) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If i understand correctly, this is the same comment that we should persist named queries in target cache as well? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not quite. I would assume that
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, problem is in the proto This brings your question though: should we always use readtime to resume. Because this change makes There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So I think the problem is that we can't tell which one is newer and we likely want the newer of the two. In stand up we discussed that the resumeToken is preferred, since it contains more information to help the backend resume at the right query position. I would think we could do something like this:
Does that work? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As further discussed, the fix is to drop Still, there are many tests rely on this behaviour now, that i want to remove the check later. |
||
result.readTime = toTimestamp( | ||
serializer, | ||
targetData.snapshotVersion.toTimestamp() | ||
); | ||
} | ||
|
||
return result; | ||
|
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 needs merging again. The call to
getNamedQuery
should call a free-standing version that takes LocalStore as an argument. All methods in FirestoreClient have been updated.Let me know if you need help with this. You can also defer to a follow up PR.
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.
Yeah, I'd like to defer to my a follow up PR.