Skip to content

Conversation

@lahirumaramba
Copy link
Member

  • Current check for update time fails for timestamps with more than 3 milliseconds places. Updated the timestamp validation logic as a quick fix.

Resolves: #1088

@lahirumaramba lahirumaramba added the release:stage Stage a release candidate label Nov 13, 2020
@lahirumaramba
Copy link
Member Author

  • Tested with both 3 and 6 milliseconds places in timestamps (updated unit tests)
  • Added release:stage to trigger integration tests
}

private isValidTimestamp(timestamp: string): boolean {
return validator.isNonEmptyString(timestamp) && (new Date(timestamp)).getTime() > 0;
Copy link
Member Author

Choose a reason for hiding this comment

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

This validation fails for timestamps before January 1, 1970 and considers strings such as "1.2" as valid timestamps. I think that would be okay for this particular scenario. Open to suggestions!

Copy link
Contributor

@hiranya911 hiranya911 left a comment

Choose a reason for hiding this comment

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

Looks good. I'd recommend adding another test case for getTemplate() so that both old and new date formats get tested.

@lahirumaramba lahirumaramba merged commit 2781eff into master Nov 13, 2020
@lahirumaramba lahirumaramba deleted the lm-rc-fix-updatetime branch November 13, 2020 21:07
BorntraegerMarc pushed a commit to BorntraegerMarc/firebase-admin-node that referenced this pull request Jan 28, 2021
* fix(rc): Fix Version update time parsing failure * Add test cases for 3 and 6 ms places
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release:stage Stage a release candidate

2 participants