Repository navigation
Conversation
🦋 Changeset detectedLatest commit: c7c595e The changes in this PR will be included in the next version bump. This PR includes changesets to release 12 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
1a621e9 to
fe99ca8
Compare
Digit runs longer than 15 significant digits fell back to parseInt, which rounds once the value no longer fits in a double, so runs such as 1100000000000000001 and 1100000000000000002 compared as equal. Compare the significant lengths instead, and runs of equal length as digit strings.
fe99ca8 to
c7c595e
Compare
🎯 Changes
sortFn_alphanumericandsortFn_alphanumericCaseSensitivecompare digit runs of up to 15 significant digits exactly. Longer runs fall back toparseInt, which rounds once the value no longer fits in a double, so different runs such as1100000000000000001and1100000000000000002compare as equal. A column of snowflake-style IDs sent as strings then sorts wrong when it usesalphanumeric, either directly or by registeringsortFn_alphanumericfor'auto'as the sorting example does.This replaces only that fallback: the run with more significant digits is larger, and runs of equal length compare as digit strings, which orders them by value. The fast path for 15 digits or fewer and
parseSmallIntare unchanged. This is the comparison that the perf notes for #6371 describe as "strictly more correct but observable" and left out to keep the behavior identical (perf-done.md). Digit runs thatparseIntcollapsed now compare by value, and so does the order those ties used to leave to the following chunks.Added a test with four assertions to
sortFns.test.ts. It fails onmain.✅ Checklist
pnpm testandpnpm test:e2e, or these tests do not apply to this pull request.🚀 Release Impact
Summary by CodeRabbit