Repository navigation
[NO QA] Fix TypeError when attendees is corrupted by Onyx merge - #83941
Conversation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Sorry for the bump @situchan @trjExpensify, please ignore. |
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
situchan
left a comment
There was a problem hiding this comment.
No need C+ review. Just approving to pull up engineer.
|
@madmax330 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safari |
|
🚧 @madmax330 has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/madmax330 in version: 9.3.31-0 🚀
|
|
🚀 Deployed to production by https://github.com/blimpich in version: 9.3.31-12 🚀
|
Explanation of Change
I'm app deployer this week and noticed this new error where
_e.filter is not a functionis recurring for some users. After investigating, it seems like sometimestransaction.comment.attendeesgets corrupted and turned into an object, which is truthy in JS. We should be defaulting to an empty array in this case, but instead we move forward and this causes the typeerrorTypeError: _e.filter is not a function.This PR adds a
Array.isArray()guard in bothViolationsUtils.tsandTransactionUtils/index.tsto handle this case more gracefully.Fixed Issues
$ #83936
Tests
Offline tests
N/A - this is a defensive type guard, not a network-dependent change.
QA Steps
// [No QA] - Mechanical Array.isArray guard addition. The fix prevents a crash when Onyx deep-merge corrupts an array into an object. No UI or behavioral change.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)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
N/A - no UI changes
Android: mWeb Chrome
N/A - no UI changes
iOS: Native
N/A - no UI changes
iOS: mWeb Safari
N/A - no UI changes
MacOS: Chrome / Safari
N/A - no UI changes