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(satellite): Ensure decimal point in real number encoding #508

Merged
merged 4 commits into from
Oct 4, 2023

Conversation

alco
Copy link
Member

@alco alco commented Sep 29, 2023

Fixes VAX-1078.

Related: #507

@linear
Copy link

linear bot commented Sep 29, 2023

VAX-1078 Client write to a float column fails to validate on the server

Reported in Discord — https://discord.com/channels/933657521581858818/1079688869852753981/1154950112414535753.

The problem happens when a whole number is written into a float column, e.g. 1695431807821. It is sent to the server without the decimal point and that results in a validation failure.

The server explicitly checks that a float number has a decimal point and at least one place following it, e.g. 1695431807821.0. This was a deliberate choice to avoid conflating integers and floats and instead make them have completely disjoint sets of possible values.

The client needs to make sure that a floating point number always has a decimal point when encoded for the Satellite protocol.

@alco alco requested a review from kevin-dp September 29, 2023 13:22
@alco alco force-pushed the alco/vax-1078-encode-real-number-with-decimal-point branch from e2de116 to a414388 Compare September 30, 2023 05:32
Copy link
Contributor

@kevin-dp kevin-dp left a comment

Choose a reason for hiding this comment

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

LGTM 👍

clients/typescript/src/util/common.ts Outdated Show resolved Hide resolved
@alco alco merged commit 8dbd8bd into main Oct 4, 2023
6 checks passed
@alco alco deleted the alco/vax-1078-encode-real-number-with-decimal-point branch October 4, 2023 08:31
alco added a commit that referenced this pull request Oct 4, 2023
alco added a commit that referenced this pull request Oct 5, 2023
alco added a commit that referenced this pull request Oct 5, 2023
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.

2 participants