Skip to content

Allow leading zeros in tryParseInt #2212

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

Merged
merged 4 commits into from
Sep 30, 2019
Merged

Conversation

schmidt-sebastian
Copy link
Contributor

Fixes https://buganizer.corp.google.com/issues/141298281

A customer noticed that we don't correctly order their documents. Some of their documents are using keys of the form "00x", where x is a 9 digit number. Our number check only allows for ten digits, and leading zeros can break this limit. This PR relaxes the check and matches the backend semantics.

@@ -20,8 +20,8 @@ import { Path } from '../src/core/util/Path';

describe('Path Tests', function() {
const expectGreater = function(left, right) {
expect(Path.comparePaths(new Path(left), new Path(right))).to.equal(1);
expect(Path.comparePaths(new Path(right), new Path(left))).to.equal(-1);
expect(Path.comparePaths(new Path(left), new Path(right))).to.be.greaterThan(0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing semicolon?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, on GitHub it is missing. But I swear that I have this locally (via the Prettier commit that once again got stuck somewhere...)

Copy link
Contributor

@mikelehen mikelehen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW (this isn't assigned to anybody so maybe you don't care if it's reviewed)- LGTM assuming CI being completely broken is unrelated to your changes.

@schmidt-sebastian
Copy link
Contributor Author

CI is passing now after a re-run.

@schmidt-sebastian schmidt-sebastian merged commit 84c1583 into master Sep 30, 2019
@schmidt-sebastian schmidt-sebastian deleted the mrschmidt/leadingzeros branch October 10, 2019 22:55
@firebase firebase locked and limited conversation to collaborators Oct 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants