Skip to content
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

Fix 6-year old padding bug, upgrade dependencies #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

oliverwoodings
Copy link

This was identified through SonarQube!

We have been incorrectly constructing ISO date strings for over 6 years now, which is ironic because the purpose of JSON bourne is to correctly encode dates and other things to the correct standards 🤦

The bug is due to the pad function not supporting a length parameter, but when used in code it was assumed that it does. This means that if the millisecond component of the date being stringified was less than 100, it would only be 2 characters long instead of being correctly padded to 3, and if it was less than 10, it would be 1 character!

Luckily this hasn't actually caused any issues because most date libraries will be able to deal with the missing digits.

I had to update basically every dependency to get this working lol.

@KidkArolis
Copy link

😱

Copy link

@alanclarke alanclarke left a comment

Choose a reason for hiding this comment

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

sick

@roberttod
Copy link
Contributor

Movie on 2-11-21 at 6 05 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants