-
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/28925: Anonymous user can edit profile #29248
Fix/28925: Anonymous user can edit profile #29248
Conversation
So currently, I am missing the mobile native and desktop screenshots |
@burczu please help review this PR when you have a chance. Thanks |
@DylanDylann In terms native and desktop, I think we can skip testing them here, so please check all the checkboxes and leave a suitable comments in screenshots/videos section of native environments. |
Reviewer Checklist
Screenshots/VideosWebScreen.Recording.2023-10-26.at.10.41.05.movMobile Web - ChromeMobile Web - SafariDesktopiOSAndroid |
@DylanDylann I've encountered strange behaviour while testing this PR. Please take a look at the video below: Screen.Recording.2023-10-13.at.07.42.57.movI think this should be handled here too, because it may case a regression. |
Do you have any suggestions about the expected behavior? |
@DylanDylann Two options: clicking back should do nothing or removing this back button. |
@DylanDylann Actually - wait :) I think this back button should actually just close the sidebar. What do you think? |
@burczu yeah. So i think we just need to close the side bar when clicking on back button |
@burczu just updated the PR and here is the result: Screencast.from.13-10-2023.13.40.40.webm |
@burczu please help review this PR when you have a chance. Thanks |
@DylanDylann Thanks for addressing the issue with back button. Unfortunately I've encountered the same issue (second sidebar shows up for a second) event when I try to open Screen.Recording.2023-10-16.at.14.21.26.mov |
@burczu I think it is an edge case because I can just handle the |
@burczu Friendly BUMP - Do you have any suggestion for this one or we will consider it as an edge case ?#29248 (comment) |
@stitesExpensify should we consider it as an edge case? |
@DylanDylann I don't think we should consider it as an edge case - there is a glitch and I bet it will be raised as a bug in the future, so I think we should try to find a solution for this. Sorry for the delayed answer, I had a lot other thinks to work on. I'll think about the possible solution here later today. |
Hey @DylanDylann I've checked the new solution and I think it's the step in a good direction - I still can see the I tend to think I could approve it and see what the Expensify engineer thinks about it. |
cd4148c
to
a14e7ff
Compare
@burczu I`ve fixed the conflict but the latest change in the main branch makes the app crash so I cannot test. Will ping you when it is fixed #30228 (comment) |
@burczu the main is fixed, just tested and it works well. Here is the result: Screencast.from.26-10-2023.10.11.23.webm |
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.
Code LGTM
@stitesExpensify I've approved this PR, but there is one thing that concerns me. Please see the below video: Screen.Recording.2023-10-26.at.10.41.05.movWhen we type |
@stitesExpensify please help review this PR when you have a chance |
@stitesExpensify friendly bump in case you miss this one |
✋ 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/stitesExpensify in version: 1.3.96-0 🚀
|
🚀 Deployed to production by https://github.com/puneetlath in version: 1.3.96-15 🚀
|
🚀 Deployed to production by https://github.com/puneetlath in version: 1.3.97-7 🚀
|
@@ -24,7 +24,7 @@ function SignInModal() { | |||
shouldEnableMaxHeight | |||
testID={SignInModal.displayName} | |||
> | |||
<HeaderWithBackButton /> | |||
<HeaderWithBackButton onBackButtonPress={Navigation.dismissModal} /> |
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 caused inconsistency between browser back button and modal back button. (Coming from #33417)
* @param {string} route | ||
*/ | ||
|
||
const canAccessRouteByAnonymousUser = (route: string) => { |
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.
canAnonymousUserAccessRoute
would sound better
if (route.startsWith('/')) { | ||
routeRemovedReportId = routeRemovedReportId.slice(1); | ||
} | ||
const routesCanAccessByAnonymousUser = [ROUTES.SIGN_IN_MODAL, ROUTES.REPORT_WITH_ID_DETAILS.route, ROUTES.REPORT_WITH_ID_DETAILS_SHARE_CODE.route]; |
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.
routesAccessibleByAnonymousUser
would sound 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.
Fixed here: #37952
@@ -871,6 +871,33 @@ function waitForUserSignIn(): Promise<boolean> { | |||
}); | |||
} | |||
|
|||
/** | |||
* check if the route can be accessed by anonymous user |
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.
Updating this comment (or adding a comment in the function) to say why an anonymous user can only access different routes would be helpful for future programmers like me who don't have context on why this exists (in general, comments should be used to explain why the code is like that, not what the code is obviously doing)
Details
Public room as anonymous user can able to edit profile
Fixed Issues
$ #28925
PROPOSAL: #28925 (comment)
Tests
Offline tests
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)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)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
There is a problem when testing with mobile native platform: Go to the public room with an anonymous user encountered the bellow error: (Which existed in the latest staging as well)
Android: mWeb Chrome
Screencast.from.11-10-2023.09.21.00.webm
iOS: Native
There is a problem when testing with mobile native platform: Go to the public room with an anonymous user encountered the bellow error: (Which existed in the latest staging as well)
iOS: mWeb Safari
Safari-room-output.mp4
MacOS: Chrome / Safari
MacOS-room-output.mp4
MacOS: Desktop
Cannot go to the public room with an anonymous user on desktop