-
Notifications
You must be signed in to change notification settings - Fork 938
Rename proto_values->values, create values.test.ts #2750
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
Rename proto_values->values, create values.test.ts #2750
Conversation
1d020eb
to
5a90ea2
Compare
5a90ea2
to
ef0cad8
Compare
ef0cad8
to
d69fe94
Compare
Note: The first commit just moves code around, the second is the diff. |
@@ -385,6 +385,10 @@ function canonifyGeoPoint(geoPoint: api.LatLng): string { | |||
return `geo(${geoPoint.latitude},${geoPoint.longitude})`; | |||
} | |||
|
|||
function canonifyReference(referenceValue: string): string { | |||
return DocumentKey.fromName(referenceValue).toString(); |
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.
Doesn't this break existing canonical IDs?
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.
Yes, but the feature branch includes the schema migration.
it('normalizes values for equality', () => { | ||
// Each subarray compares equal to each other and false to every other value | ||
const values: api.Value[][] = [ | ||
[{ integerValue: '1' }, { integerValue: 1 }], |
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.
Isn't there also a case where there's a nested value object?
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.
If you are referring to the Int32Proto
, this seems to only be used in a target's limit
specification, which allows us to encode a difference between 0
and unset. I don't see any usage for this patten in api.Value.
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.
Ah, I see. Right.
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
it('normalizes values for equality', () => { | ||
// Each subarray compares equal to each other and false to every other value | ||
const values: api.Value[][] = [ | ||
[{ integerValue: '1' }, { integerValue: 1 }], |
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.
Ah, I see. Right.
See #2715 for the bigger picture (and the source of values.test.ts, but it is mostly just a move of code)