Skip to content

fix(native): Don't fail deserializing JS numbers above u64/i64 range#11033

Merged
ovr merged 1 commit into
lts/v1.4from
fix/native-deserialize-large-number
Jun 8, 2026
Merged

fix(native): Don't fail deserializing JS numbers above u64/i64 range#11033
ovr merged 1 commit into
lts/v1.4from
fix/native-deserialize-large-number

Conversation

@ovr

@ovr ovr commented Jun 8, 2026

Copy link
Copy Markdown
Member

A JS number like 5.18e44 is integer-valued (fract() is always 0.0 for |value| >= 2^52, since an f64 has no fractional bits at that magnitude), so it skipped the float path, then failed to fit in any u64/i64 branch and hit "Unsupported number type for deserialization".

Fall back to visit_f64 for such values instead of erroring. The value already arrived as an f64, so nothing is lost beyond JS's own precision.

A JS number like 5.18e44 is integer-valued (fract() is always 0.0 for
|value| >= 2^52, since an f64 has no fractional bits at that magnitude),
so it skipped the float path, then failed to fit in any u64/i64 branch
and hit "Unsupported number type for deserialization".

Fall back to visit_f64 for such values instead of erroring. The value
already arrived as an f64, so nothing is lost beyond JS's own precision.
@ovr ovr requested a review from a team as a code owner June 8, 2026 12:05
@github-actions github-actions Bot added the rust Pull requests that update Rust code label Jun 8, 2026
@codecov

codecov Bot commented Jun 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.34%. Comparing base (1b0a5b7) to head (386d720).
⚠️ Report is 9 commits behind head on lts/v1.4.

Additional details and impacted files
@@             Coverage Diff              @@
##           lts/v1.4   #11033      +/-   ##
============================================
+ Coverage     77.98%   83.34%   +5.35%     
============================================
  Files           468      244     -224     
  Lines         91368    74112   -17256     
  Branches       3498        0    -3498     
============================================
- Hits          71253    61767    -9486     
+ Misses        19617    12345    -7272     
+ Partials        498        0     -498     
Flag Coverage Δ
cube-backend ?
cubesql 83.34% <ø> (+0.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ovr ovr merged commit efcfe89 into lts/v1.4 Jun 8, 2026
53 of 90 checks passed
@ovr ovr deleted the fix/native-deserialize-large-number branch June 8, 2026 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rust Pull requests that update Rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants