Fix wrong default number id usages#55535
Conversation
…efault-number-id-usage # Conflicts: # src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.tsx # src/pages/iou/request/step/IOURequestStepParticipants.tsx
| const styles = useThemeStyles(); | ||
| const backTo = route.params.backTo; | ||
|
|
||
| // The app would crash due to subscribing to the entire report collection if parentReportID is an empty string. So we should have a fallback ID here. |
There was a problem hiding this comment.
Not crashing anymore after removing default '' parentReportID value during optimistic chat creation
…efault-number-id-usage # Conflicts: # src/components/ReportActionItem/MoneyRequestAction.tsx # src/libs/actions/Report.ts # src/pages/home/report/ReportActionItemContentCreated.tsx # src/pages/workspace/AccessOrNotFoundWrapper.tsx
|
@paultsimura 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] |
|
The |
| const participants = [session?.accountID ?? -1]; | ||
| const parsedDescription = ReportUtils.getParsedComment(values.reportDescription ?? '', {policyID}); | ||
| const policyReport = ReportUtils.buildOptimisticChatReport( | ||
| const participants = session?.accountID ? [session.accountID] : []; |
There was a problem hiding this comment.
| const participants = session?.accountID ? [session.accountID] : []; | |
| const participants = [session?.accountID ?? CONST.DEFAULT_NUMBER_ID]; |
NAB: we are allowed to default to number id here, but I think your way makes more sense
|
Thanks for the ping, looking into the failures now. No need to block on it passing. |
Reviewer Checklist
Screenshots/VideosAndroid: NativeAndroid: mWeb ChromeiOS: NativeiOS: mWeb SafariMacOS: Chrome / SafariScreen.Recording.2025-01-29.at.23.00.34.movMacOS: Desktop |
This comment was marked as resolved.
This comment was marked as resolved.
thienlnam
left a comment
There was a problem hiding this comment.
Time to get rid of the default IDs 🚀
|
@thienlnam looks like this was merged without a test passing. Please add a note explaining why this was done and remove the |
Explanation of Change
Remove wrongly used defaulting value
CONST.DEFAULT_NUMBER_IDin cases, when it was used inside a string.Fixed Issues
$ #50360
$ #55814
PROPOSAL: N/A
Tests
Part 1: Expenses related
Create Expenseflow.Create Expenseflow.Create Expenseflow.Create Expenseflow.Part 2: Chats related
Offline tests
Same, as in the Tests section.
QA Steps
Same, as in the Tests section.
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))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
android1.mp4
Android: mWeb Chrome
android_web1.mp4
iOS: Native
ios1.mp4
iOS: mWeb Safari
ios_web1.mp4
MacOS: Chrome / Safari
web1.mp4
MacOS: Desktop
desktop1.mp4