fix(success response handler): parse unsafe integers as strings #834
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
JavaScript will automatically round integers that are outside of its "safe" bounds, i.e., from -(2^53 - 1) to 2^53 - 1, inclusive (±9,007,199,254,740,991). This means we'll lose precision if we convert values beyond those boundaries to integers.
The suggested fix is to return out of bound integers as strings, such that no precision will be lost.
Technically, this means that any number in a successful response body will be typed as a number (if it's safe) or as as string (if it's unsafe).
I decided not to adjust the response body interfaces, because this should happen only in a few exceptional cases (e.g.,
rowid
/sysrowid
, which are returned as very large integers).Acceptance Criteria