-
Notifications
You must be signed in to change notification settings - Fork 617
Add expected count to target #4574
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 all commits
ff97c00
f876824
d7806f3
ae7edd0
89fb871
ef1a6e9
e9bace3
a241d07
c26b4e5
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 |
---|---|---|
|
@@ -499,6 +499,13 @@ public Target encodeTarget(TargetData targetData) { | |
builder.setResumeToken(targetData.getResumeToken()); | ||
} | ||
|
||
// TODO(Mila) Incorporate this into the if statement above. | ||
if (targetData.getExpectedCount() != null | ||
&& (!targetData.getResumeToken().isEmpty() | ||
|| targetData.getSnapshotVersion().compareTo(SnapshotVersion.NONE) > 0)) { | ||
builder.setExpectedCount(Int32Value.newBuilder().setValue(targetData.getExpectedCount())); | ||
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. This code block is inconsistent with the web sdk. In the web sdk, it only sets expectedCount if a resume token or snapshot version is specified. Here, it is setting expectedCount regardless of whether or not a resume token or snapshot version is specified. We generally aim to keep the sdks in sync as much as possible because it's confusing when things are done differently in one sdk compared to another. Please make the two SDKs do the same thing in this scenario. I think the way that the web sdk does it is best because it makes it very clear that expectedCount is only meaningful if a resume token or snapshot version is used. 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. yeah, this is the part that I am a bit hesitated. In web the if statments is like:
while in Android it is
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. updated the if statement to indicate resume token or snapshotVersion is required to add expectedCount:
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. Even though the "if" statement has the extra check for |
||
} | ||
|
||
return builder.build(); | ||
} | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.