-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix wrong default number id usages #55535
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
@@ -166,12 +166,9 @@ function ReportDetailsPage({policies, report, route, reportMetadata}: ReportDeta | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM ✔️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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_ID
in cases, when it was used inside a string.Fixed Issues
$ #50360
$ #55814
PROPOSAL: N/A
Tests
Part 1: Expenses related
Create Expense
flow.Create Expense
flow.Create Expense
flow.Create Expense
flow.Part 2: Chats related
Offline tests
Same, as in the Tests section.
QA Steps
Same, as in the Tests section.
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.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