Skip to content

feat: React Native SDK update for version 0.24.1#90

Merged
abnegate merged 3 commits intomainfrom
dev
Feb 23, 2026
Merged

feat: React Native SDK update for version 0.24.1#90
abnegate merged 3 commits intomainfrom
dev

Conversation

@ChiragAgg5k
Copy link
Member

@ChiragAgg5k ChiragAgg5k commented Feb 23, 2026

This PR contains updates to the React Native SDK for version 0.24.1.

Summary by CodeRabbit

  • Bug Fixes

    • Prevented extremely large floating-point values (e.g., 1.7976931348623157e+308) from being expanded into huge integer literals, improving numeric parsing and display correctness.
  • Chores

    • Package version updated to 0.24.1.

@coderabbitai
Copy link

coderabbitai bot commented Feb 23, 2026

No actionable comments were generated in the recent review. 🎉


Walkthrough

Updated CHANGELOG.md with a new 0.24.1 entry describing a fix that prevents very large double values (e.g., 1.7976931348623157e+308) from being expanded into giant integer literals. package.json version was bumped from 0.24.0 to 0.24.1. src/client.ts added 64-bit integer bounds (MAX_INT64, MIN_INT64) and adjusted the JSON reviver: preserve Numbers within the safe JS range, convert integer BigNumber values within 64-bit range to BigInt, and fall back to value.toNumber() for out-of-range integers; the SDK header x-sdk-version was updated to 0.24.1.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Title check ⚠️ Warning The PR title references version 0.24.1, but the PR objectives and CHANGELOG indicate version 0.23.2; additionally, the title is overly generic ('SDK update') and doesn't specify the main fix (preventing large double values from expanding into giant integer literals). Update the title to accurately reflect version 0.23.2 and specify the primary fix, such as: 'Fix very large double values from expanding into giant integer literals' or 'chore: Bump React Native SDK to 0.23.2 with double value fix'.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dev

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/client.ts (1)

24-36: Consider string-length pre-check to skip unnecessary BigInt allocation for values clearly outside INT64 range.

For floats like 1.7976931348623157e+308, isInteger() returns true in bignumber.js (no fractional part at that scale), so toFixed() produces a ~309-character string and BigInt(str) allocates a large BigInt — only to immediately discard it at line 34. A length guard short-circuits the allocation before the out-of-range branch:

⚡ Proposed optimization: pre-check string length before BigInt allocation
 function reviver(_key: string, value: any): any {
     if (isBigNumber(value)) {
         if (value.isInteger()) {
             const str = value.toFixed();
+            // MAX_INT64 is 19 digits; MIN_INT64 is 20 chars (with leading '-')
+            const isNeg = str.length > 0 && str[0] === '-';
+            if ((!isNeg && str.length > 19) || (isNeg && str.length > 20)) {
+                return value.toNumber();
+            }
             const bi = BigInt(str);
             if (bi >= MIN_SAFE && bi <= MAX_SAFE) {
                 return Number(str);
             }
             if (bi >= MIN_INT64 && bi <= MAX_INT64) {
                 return bi;
             }
             return value.toNumber();
         }
         return value.toNumber();
     }
     return value;
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/client.ts` around lines 24 - 36, The current code calls BigInt(str) after
value.toFixed(), which can allocate huge BigInts for extreme magnitudes; add a
cheap string-length guard before creating a BigInt: after computing const str =
value.toFixed(); check the trimmed numeric length (e.g. const digits =
str.startsWith('-') ? str.length - 1 : str.length) and if digits exceeds the max
decimal digits for INT64 (19) immediately skip BigInt allocation and return
value.toNumber() (or the appropriate fallback) instead of executing BigInt(str);
update the branch around isBigNumber/value.isInteger() that uses
MIN_INT64/MAX_INT64 and BigInt(str) to use this length check to short-circuit.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/client.ts`:
- Around line 24-36: The current code calls BigInt(str) after value.toFixed(),
which can allocate huge BigInts for extreme magnitudes; add a cheap
string-length guard before creating a BigInt: after computing const str =
value.toFixed(); check the trimmed numeric length (e.g. const digits =
str.startsWith('-') ? str.length - 1 : str.length) and if digits exceeds the max
decimal digits for INT64 (19) immediately skip BigInt allocation and return
value.toNumber() (or the appropriate fallback) instead of executing BigInt(str);
update the branch around isBigNumber/value.isInteger() that uses
MIN_INT64/MAX_INT64 and BigInt(str) to use this length check to short-circuit.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@CHANGELOG.md`:
- Around line 3-5: Update the changelog header that currently reads "## 0.24.1"
to match the actual package release version ("0.23.2") so the entry aligns with
package.json and SDK headers; locate the header string "## 0.24.1" in
CHANGELOG.md and replace it with "## 0.23.2" to correct ordering and version
consistency.

Comment on lines +3 to +5
## 0.24.1

* Fix very large double values (for example 1.7976931348623157e+308) from being expanded into giant integer literals.
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Changelog version header doesn't match the release version.

The entry is labelled ## 0.24.1, but every other artefact in this PR (package.json, src/client.ts SDK header) targets version 0.23.2. With an existing ## 0.24.0 entry already in the file, this also creates a confusing ordering where two 0.24.x entries sit above a 0.23.1 entry while the actual package version is 0.23.2.

The heading should be changed to match the actual release:

📝 Proposed fix
-## 0.24.1
+## 0.23.2
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
## 0.24.1
* Fix very large double values (for example 1.7976931348623157e+308) from being expanded into giant integer literals.
## 0.23.2
* Fix very large double values (for example 1.7976931348623157e+308) from being expanded into giant integer literals.
🧰 Tools
🪛 LanguageTool

[style] ~5-~5: As an alternative to the over-used intensifier ‘very’, consider replacing this phrase.
Context: # Change log ## 0.24.1 * Fix very large double values (for example 1.7976931348...

(EN_WEAK_ADJECTIVE)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@CHANGELOG.md` around lines 3 - 5, Update the changelog header that currently
reads "## 0.24.1" to match the actual package release version ("0.23.2") so the
entry aligns with package.json and SDK headers; locate the header string "##
0.24.1" in CHANGELOG.md and replace it with "## 0.23.2" to correct ordering and
version consistency.

src/client.ts Outdated
Comment on lines 156 to 161
'x-sdk-version': '0.24.0',
'x-sdk-version': '0.23.2',
Copy link
Member

Choose a reason for hiding this comment

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

Version downgrade

@ChiragAgg5k ChiragAgg5k changed the title feat: React Native SDK update for version 0.23.2 feat: React Native SDK update for version 0.24.1 Feb 23, 2026
@abnegate abnegate merged commit d287ed8 into main Feb 23, 2026
1 check passed
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