Skip to content

fix: fixes language comparing in react-native sdk#67

Merged
pandeymangg merged 1 commit into
mainfrom
fix/language-comparing
Jun 26, 2026
Merged

fix: fixes language comparing in react-native sdk#67
pandeymangg merged 1 commit into
mainfrom
fix/language-comparing

Conversation

@pandeymangg

Copy link
Copy Markdown
Contributor

Fixes language comparing in the sdk, now both survey.language.code and the stored language.code are lowercased first

@pandeymangg pandeymangg requested a review from Dhruwang June 26, 2026 10:42
@sonarqubecloud

Copy link
Copy Markdown

@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

getLanguageCode() was updated to compare stored language codes and the requested language case-insensitively. A new test covers a region-tagged canonical code, de-DE, and checks that the function returns the canonical casing when matched.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title matches the main change: fixing language comparison in the React Native SDK.
Description check ✅ Passed The description clearly describes the same lowercase language comparison fix as the code changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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 current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/react-native/src/lib/common/tests/utils.test.ts`:
- Around line 457-465: The test in getLanguageCode is not proving
case-insensitive matching because it uses the same casing for input and expected
output. Update the region-tagged canonical code case in the utils.test.ts suite
so getLanguageCode is called with a differently cased value like "de-de" while
still expecting the canonical result "de-DE", keeping the existing survey
fixture and assertion structure intact.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 1409f47e-9899-4998-b43f-52c8acee91a6

📥 Commits

Reviewing files that changed from the base of the PR and between 34b2650 and 7ce6aa9.

📒 Files selected for processing (2)
  • packages/react-native/src/lib/common/tests/utils.test.ts
  • packages/react-native/src/lib/common/utils.ts

Comment thread packages/react-native/src/lib/common/tests/utils.test.ts
@pandeymangg pandeymangg added this pull request to the merge queue Jun 26, 2026
Merged via the queue into main with commit 11f30df Jun 26, 2026
10 checks passed
@pandeymangg pandeymangg deleted the fix/language-comparing branch June 26, 2026 10:57
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