-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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: IOU-Error message remains on IOU report even same error message is dismissed from 1:1 #37875
Conversation
@DylanDylann 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] |
@DylanDylann Can you help review my PR when you have a chance? Thanks |
src/libs/actions/ReportActions.ts
Outdated
} | ||
} | ||
|
||
export {clearReportActionErrors, clearAllRelatedReportActionErrors}; |
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.
export {clearReportActionErrors, clearAllRelatedReportActionErrors}; | |
export {clearAllRelatedReportActionErrors}; |
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.
@DylanDylann Should we remove this function? We still use it in other places such as IOUTest.js
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.
whoops, Yeah let's keep it exported
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.
If it's only used in a test, can we update the test to use the next function?
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-03-20.at.12.03.55.movAndroid: mWeb Chromem.mp4iOS: NativeScreen.Recording.2024-03-20.at.11.42.30.mp4iOS: mWeb SafariScreen.Recording.2024-03-20.at.11.39.45.movMacOS: Chrome / SafariScreen.Recording.2024-03-20.at.11.34.40.movScreen.Recording.2024-03-20.at.11.35.58.movMacOS: DesktopScreen.Recording.2024-03-20.at.11.41.23.mov |
Still testing |
@tienifr Your change looks good. Please help to merge the main then I can make a final testing |
@@ -33,14 +35,55 @@ function clearReportActionErrors(reportID: string, reportAction: ReportAction) { | |||
return; | |||
} | |||
|
|||
if (keys) { |
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.
This is to handle cases with multiple errors in the same report action, right?
It may be a good improvement but It is not mentioned in the issue. Why do you think It is our expectation? Do you confirm with the design team or any internal engineer about that?
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.
This is to handle cases with multiple errors in the same report action, right?
Yes
Why do you think It is our expectation?
When users click x button, we'll clear all errors of that action, so the related action can share some same errors and we need to clear all of them. I believe it's the expectation in the OP
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.
I agree that's the expectation
const parentReportAction = ReportActionUtils.getReportAction(report.parentReportID, report.parentReportActionID); | ||
const parentErrorKeys = Object.keys(parentReportAction?.errors ?? {}).filter((err) => errorKeys.includes(err)); | ||
|
||
clearAllRelatedReportActionErrors(report.parentReportID, parentReportAction, 'child', parentErrorKeys); |
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.
Please point out 1 case where we need to call clearAllRelatedReportActionErrors
instead of clearReportActionErrors
.
The current logic is fine but I am not sure if we need it or not
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.
I already used it in
Pls correct me if I misunderstand sth
const childActions = ReportActionUtils.getAllReportActions(reportAction.childReportID); | ||
Object.values(childActions).forEach((action) => { | ||
const childErrorKeys = Object.keys(action.errors ?? {}).filter((err) => errorKeys.includes(err)); | ||
clearAllRelatedReportActionErrors(reportAction.childReportID ?? '', action, 'parent', childErrorKeys); |
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.
Please point out 1 case where we need to call clearAllRelatedReportActionErrors instead of clearReportActionErrors.
The current logic is fine but I am not sure if we need it or not
@tienifr For this point, I mean that in 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.
Well, we need to use clearAllRelatedReportActionError
here since we need to clear the errors of the grandchildren/grandparent report actions. Currently we do not have any such cases but in the future there may be. clearAllRelatedReportActionErrors is more general than clearReportActionErrors so I believe it's better
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.
There's a conflict to fix as well!
src/libs/actions/ReportActions.ts
Outdated
} | ||
} | ||
|
||
export {clearReportActionErrors, clearAllRelatedReportActionErrors}; |
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.
If it's only used in a test, can we update the test to use the next function?
@@ -33,14 +35,55 @@ function clearReportActionErrors(reportID: string, reportAction: ReportAction) { | |||
return; | |||
} | |||
|
|||
if (keys) { |
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.
I agree that's the expectation
Yes, anytime we can reasonably write a test we should. Also the Reassure performance tests are failing, although merging main should clear that up I believe. |
@DylanDylann Added tests |
@DylanDylann Added tests |
Looks good. @amyevans All yours |
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.
Thanks!
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
Details
Fixed Issues
$ #34189
PROPOSAL: #34189 (comment)
Tests
Flow 1:
Flow 2:
Offline tests
Same as above
QA Steps
Flow 1:
Flow 2:
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.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 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
Screen.Recording.2024-03-07.at.17.12.49.mov
Screen.Recording.2024-03-07.at.17.13.56.mp4
Android: mWeb Chrome
Screen.Recording.2024-03-07.at.17.08.48.mov
Screen.Recording.2024-03-07.at.17.09.50.mov
iOS: Native
Screen.Recording.2024-03-07.at.17.27.48.mov
Screen.Recording.2024-03-07.at.17.28.36.mp4
iOS: mWeb Safari
Screen.Recording.2024-03-07.at.16.59.54.mov
Screen.Recording.2024-03-07.at.17.01.32.mov
MacOS: Chrome / Safari
Screen.Recording.2024-01-22.at.18.00.00.mov
MacOS: Desktop
Screen.Recording.2024-03-07.at.16.35.25.mp4
Screen.Recording.2024-03-07.at.16.33.26.mp4