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

Disable an incorrect optimization in int64ToString #366

Closed

Conversation

ajpalkovic
Copy link

We've run into a bug where a timestamp seems to be experiencing some bit-flipping

I added a test case here that demonstrates the problem. If BigInt is not available (which is the case when running in react-native), the test will fail, printing out: - Expected '1657029432704' to be '1661324400000'.

A colleague printed out the bits for a different timestamp that shows where the flipping is happening:
image

I don't fully understand the int64toString function, so I chose to just disable the optimization, which does fix this problem. I saw it was copied from an experimental directory of the google protobuf implementation, so I'm guessing they just didn't fully test and verify this yet, so disabling the optimization was probably the better short term play?

@timostamm
Copy link
Owner

Closing this in favor of #367.

Looking at https://github.com/protocolbuffers/protobuf, this seems to have been broken for a while.

@timostamm timostamm closed this Aug 29, 2022
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.

None yet

2 participants