You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a crash (only on Android) related to passing undefined key values to native.
Basically, everywhere we pass more complex object to native, we use spread operator.
It makes a copy of the key:value pairs, so it brings undefined (if set) to native, without setting a default value there.
This results in crashes happening on Android only, because it has a strict props parser (iOS one is rather lenient).
The fix omits undefined-valued pairs, resulting in using default values again.
Test Plan
Set mentions' htmlStyle to
{ borderRadius: undefined }
and run the Android app. It should not crash anymore and make mentions attain default 0 border radius.
Screenshots / Videos
Before (recorded via Argent)
android-undefined-style-before.mp4
After (recorded via Argent)
android-undefined-style-after.mp4
Compatibility
OS
Implemented
iOS
❌
Android
✅
Web
❌
Checklist
E2E tests are passing
Required E2E tests have been added (if applicable)
Reviewing files that changed from the base of the PR and between 3b87756 and 67b6cc5.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Walkthrough
Style normalization now omits undefined properties when merging styles. Added tests check that defaults remain in place for undefined values and that defined values are preserved.
Changes: Style normalization
Layer / File(s)
Summary
Omit undefined values during style merging src/utils/omitUndefined.ts, src/utils/expandMentionStylesForIndicators.ts, src/utils/normalizeHtmlStyle.ts, src/utils/__tests__/normalizeHtmlStyle.test.ts
Added omitUndefined and use it when merging mention styles and other style entries. Tests cover default fallback for undefined values and preservation of defined values.
The change omits undefined-valued style keys before they reach native code, so native defaults apply instead of crashing Android. Unit tests cover fallback and preservation. No concrete merge-blocking risk was found.
Pre-merge checks: 4
Check name
Status
Explanation
Description check
The description states the Android crash cause: undefined key values copied by the spread operator reach native code and fail its strict props parser. It gives a test plan using borderRadius set to un…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Title check
The title says the fix addresses Android crashes caused by undefined-valued object pairs. The objectives and raw summary confirm the change omits undefined-valued keys from objects passed to native co…
Full details: Description check
Explanation
The description states the Android crash cause: undefined key values copied by the spread operator reach native code and fail its strict props parser. It gives a test plan using borderRadius set to undefined and shows the expected default 0 result. This matches the changeset, so it passes.
Full details: Title check
Explanation
The title says the fix addresses Android crashes caused by undefined-valued object pairs. The objectives and raw summary confirm the change omits undefined-valued keys from objects passed to native code, which prevents the Android strict props parser crash. The title names the main change and its platform. It is specific and matches the changeset. The title uses the term 'Undefined-valued object pairs', which is slightly less precise than 'object keys', but it still conveys the primary change.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
Reviewing files that changed from the base of the PR and between db60605 and 7795c39.
Files selected for processing: 4
src/utils/__tests__/normalizeHtmlStyle.test.ts
src/utils/expandMentionStylesForIndicators.ts
src/utils/normalizeHtmlStyle.ts
src/utils/omitUndefined.ts
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
szydlovsky
changed the title
fix(Android): Omit undefined-valued object keys passed to native
fix(Android): Undefined-valued object pairs crash
Dec 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Summary
We have a crash (only on Android) related to passing
undefinedkey values to native.Basically, everywhere we pass more complex object to native, we use spread operator.
It makes a copy of the key:value pairs, so it brings
undefined(if set) to native, without setting a default value there.This results in crashes happening on Android only, because it has a strict props parser (iOS one is rather lenient).
The fix omits
undefined-valued pairs, resulting in using default values again.Test Plan
Set mentions'
htmlStyletoand run the Android app. It should not crash anymore and make mentions attain default
0border radius.Screenshots / Videos
Before (recorded via Argent)
android-undefined-style-before.mp4
After (recorded via Argent)
android-undefined-style-after.mp4
Compatibility
Checklist