fix: right operand of in is not an object#47558
Merged
marcochavezf merged 1 commit intoExpensify:mainfrom Aug 20, 2024
Merged
Conversation
Contributor
Reviewer Checklist
Screenshots/VideosAndroid: NativeinAndroid.movAndroid: mWeb ChromeinAndroidmWeb.moviOS: NativeiniOS.moviOS: mWeb SafariiniOSmWeb.movMacOS: Chrome / SafariinChrome.mp4MacOS: DesktopinDesktop.mp4 |
|
We did not find an internal engineer to review this PR, trying to assign a random engineer to #46115 as well as to this PR... Please reach out for help on Slack if no one gets assigned! |
c3024
approved these changes
Aug 20, 2024
Contributor
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
38 tasks
Contributor
|
🚀 Deployed to staging by https://github.com/marcochavezf in version: 9.0.23-0 🚀
|
Contributor
|
🚀 Deployed to production by https://github.com/chiragsalian in version: 9.0.23-0 🚀
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Details
This PR fixes the issue where in some cases the value we are accessing by
somekeyinsomeObjectis not an object but rather a string or a null. Ideally, when we are accessing a key usinginoperator we usually check for the type of that object.So, the fix here is also straight forward and it's to add a
typeof someObject === 'object'condition from where the error is originating.This PR fixes the following functions which were reported by event in Firebase:
getWhisperedTo
addSpacesToEmojiCategories
ReportActionItem
getForReportAction
Since this was hard to reproduce the optimal debugging solution was to test the relevant piece of code in isolation. Below is how we tested the failing conditions for these 4 traces:
getWhisperedTo
Fails when
messageis null in second if condition.addSpacesToEmojiCategories
Fails when
emojiis a string or a numberReportActionItem
Fails when
originalMessageis a stringgetForReportAction
Fails when
reportActionOriginalMessageis a stringFixed Issues
$ #46115
PROPOSAL:
Tests
Testing Steps:
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
android.mov
Android: mWeb Chrome
android-web.mov
iOS: Native
ios.mov
iOS: mWeb Safari
ios-web.mov
MacOS: Chrome / Safari
web.mov
MacOS: Desktop
desktop.mov