-
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
Welcome message wrong link 33230 #33723
Welcome message wrong link 33230 #33723
Conversation
@shubham1206agra 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] |
const reportActionID = route?.params?.reportActionID; | ||
const regexValidReportActionID = new RegExp(/^\d*$/); | ||
if (reportActionID && !regexValidReportActionID.test(reportActionID)) { | ||
Navigation.goBack(ROUTES.HOME); |
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.
@roryabraham I am thinking we should go to report without any reportId in this case. What do you think?
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.
No, I think HOME is ok. It's the same effect as report w/o any reportID, right?
@samilabud it looks like there are merge conflicts that need to be resolved here |
5d50bb2
to
f630d73
Compare
This is ready for another review @shubham1206agra |
const reportActionID = route?.params?.reportActionID; | ||
const regexValidReportActionID = new RegExp(/^\d*$/); | ||
if (reportActionID && !regexValidReportActionID.test(reportActionID)) { | ||
Navigation.goBack(ROUTES.HOME); | ||
return; | ||
} |
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.
@samilabud We should move this logic inside if (route?.params?.reportID) {
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.
And one more thing, lets not use Navigation.goBack(ROUTES.HOME)
, use Navigation.navigate
instead as this is causing to go back in the stack to previously opened report instead of staying on the same report.
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.
Fixed thanks!, it seems there is a test failing on the main branch, I'm going to keep testing on the main until I see it is fixed and let you know.
const reportActionID = route?.params?.reportActionID; | ||
const regexValidReportActionID = new RegExp(/^\d*$/); | ||
if (reportActionID && !regexValidReportActionID.test(reportActionID)) { | ||
Navigation.navigate(ROUTES.HOME); |
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.
Lets navigate to the report without the reportActionID in this case instead.
@@ -45,6 +47,14 @@ function ReportScreenIDSetter({route, reports, policies, navigation, isFirstTime | |||
// Don't update if there is a reportID in the params already | |||
if (route?.params?.reportID) { | |||
App.confirmReadyToOpenApp(); |
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.
Is there a reason for this line to be above this logic?
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 really, additional lines were removed.
App.confirmReadyToOpenApp(); | ||
const reportActionID = route?.params?.reportActionID; | ||
const regexValidReportActionID = new RegExp(/^\d*$/); | ||
if (reportActionID && !regexValidReportActionID.test(reportActionID)) { | ||
Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(route?.params?.reportID)); | ||
return; | ||
} |
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.
App.confirmReadyToOpenApp(); | |
const reportActionID = route?.params?.reportActionID; | |
const regexValidReportActionID = new RegExp(/^\d*$/); | |
if (reportActionID && !regexValidReportActionID.test(reportActionID)) { | |
Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(route?.params?.reportID)); | |
return; | |
} | |
const reportActionID = route?.params?.reportActionID; | |
const regexValidReportActionID = new RegExp(/^\d*$/); | |
if (reportActionID && !regexValidReportActionID.test(reportActionID)) { | |
Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(route?.params?.reportID)); | |
return; | |
} | |
App.confirmReadyToOpenApp(); |
Do this instead
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.
It makes sense, thank you!
const reportActionID = route?.params?.reportActionID; | ||
const regexValidReportActionID = new RegExp(/^\d*$/); | ||
if (reportActionID && !regexValidReportActionID.test(reportActionID)) { | ||
Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(route?.params?.reportID)); | ||
return; | ||
} |
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 reportActionID = route?.params?.reportActionID; | |
const regexValidReportActionID = new RegExp(/^\d*$/); | |
if (reportActionID && !regexValidReportActionID.test(reportActionID)) { | |
Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(route?.params?.reportID)); | |
return; | |
} | |
const reportActionID = route?.params?.reportActionID; | |
const regexValidReportActionID = new RegExp(/^\d*$/); | |
if (reportActionID && !regexValidReportActionID.test(reportActionID)) { | |
navigation.setParams({reportActionID: ''}); | |
} |
Sorry, but this works 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.
Can you change to this?
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-01-01.at.9.55.49.PM.movAndroid: mWeb ChromeScreen.Recording.2024-01-01.at.10.40.56.PM.moviOS: NativeScreen.Recording.2024-01-01.at.10.50.04.PM.moviOS: mWeb SafariScreen.Recording.2024-01-01.at.10.36.22.PM.movMacOS: Chrome / SafariScreen.Recording.2024-01-01.at.10.31.30.PM.movMacOS: DesktopScreen.Recording.2024-01-01.at.10.46.29.PM.mov |
@roryabraham The jest test is failing due to current month is January |
Agree the failing tests are unrelated |
@roryabraham looks like this was merged without a test passing. Please add a note explaining why this was done and remove the |
Not an emergency, see last comment |
✋ 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/roryabraham in version: 1.4.21-0 🚀
|
🚀 Deployed to production by https://github.com/marcaaron in version: 1.4.21-4 🚀
|
1 similar comment
🚀 Deployed to production by https://github.com/marcaaron in version: 1.4.21-4 🚀
|
🚀 Deployed to production by https://github.com/marcaaron in version: 1.4.21-4 🚀
|
Details
We are not validating the URL route for the second parameter when we are building our routes for 'r' parameter, here we going edit the component ReportScreenIDSetter
and validate the reportActionID which should be numeric, and if not return the user to the last report page (chat window).
Fixed Issues
$ #33230
PROPOSAL: #33230 (comment)
Tests
Offline tests
n/a
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.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
n/a
Android: mWeb Chrome
Android.Chrome.-.Test.Deep.Link.mp4
iOS: Native
n/a
iOS: mWeb Safari
Iphone.Safari.-.Test.Deep.Link.mp4
MacOS: Chrome / Safari
Chrome.Mac.-.Test.Deep.Link.mp4
MacOS: Desktop
n/a