-
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
[HOLD for payment 2023-08-30] [$1000] Navigate back to public room after clicking on Sign-in as unauthenticated user #20558
Comments
Triggered auto assignment to @dylanexpensify ( |
Bug0 Triage Checklist (Main S/O)
|
Job added to Upwork: https://www.upwork.com/jobs/~017a21cdc86c5eee7f |
Current assignee @dylanexpensify is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @thesahindia ( |
Current assignee @marcochavezf is eligible for the External assigner, not assigning anyone new. |
Making it external in case someone wants to propose a solution during the weekend. Just some additional info, we're setting the reportID of the public room here in Onyx when we "log out" the anonymous user (maybe we can navigate to that reportID when the user clicks on the back button). |
ProposalPlease re-state the problem that we are trying to solve in this issue.When accessing a public room as an anonymous user and then clicking on sign in the navigation stack is lost What is the root cause of that problem?When sign in is pressed signOutAndRedirectToSignIn method is called, finally calling clearStorageAndRedirect. "removing the authToken redirects the user to the Sign-in page". AppNavigator class switches the navigation to PublicScreens. What changes do you think we should make in order to solve the problem?Override the back button of the browser and send to the report same as deeplinks when the button is pressed and the id exists: example of the effect in SignInPage working (POC code): useEffect(() => {
history.pushState({}, '', '/'+ROUTES.getReportRoute(lastOpenedRoomId));
const handleBackButton = () => {
if(lastOpenedRoomId && lastOpenedRoomId!==''){
//USe deeplink implementation to change stack
Report.openReportFromDeepLink(ROUTES.getReportRoute(lastOpenedRoomId), false)
}else{
history.back();
}
};
// Add event listener for the browser back button press
window.addEventListener('popstate', handleBackButton);
// Clean up the event listener when the component unmounts
return () => {
window.removeEventListener('popstate', handleBackButton);
};
}, []); What alternative solutions did you explore? (Optional)First I thought about saving the last link before navigating and cleaning but then I realized that save part was already done and explained by @marcochavezf |
Looks like something related to As a reminder, please make sure that all proposals are not workarounds and that any and all attempt to fix the issue holistically have been made before proceeding with a solution. Proposals to change our Feel free to drop a note in #expensify-open-source with any questions. |
📣 @daordonez11! 📣
|
Contributor details |
✅ Contributor details stored successfully. Thank you for contributing to Expensify! |
Hi @daordonez11 and thanks for the proposal! Could you share a quick video of that proposal working? Most of the proposal looks good, but I think I'm not understanding completely the "why" of this part:
|
Hey @marcochavezf for sure working on it! Any specific branch? I'll do it on the commit you shared, yesterday I was working on main. Also quick question, you could save lastOpenesPublicRoom before calling "redirectToSignIn" and including your key in keysToPreserve in the method clearStorageAndRedirect. Any specific reason why it is currently being done after? Sometimes in my test the signin component is loaded before the key exists in onyx so I need to handle updates. |
Hey @marcochavezf here is a video with the fix and I will update the proposal New_Recording_-_10_6_2023._23_00_13.mp4Some important stuff, the original proposal didn't work because PuclicScreens and AuthScreens are different navigators, so you cannot simply navigate between both, hence resetting the navigation doesn't work. |
Oh this was hotfix and is just a temporal solution, since we're still changing things in the backend to share the report with the user signed in. When I implemented it I forgot we could include it in the keysToPerserve, thanks for pointing that! |
Also thanks for updating the proposal! Yeah, given the current structure of the navigators I think it makes sense to listen the popstate, but I think this solution will work only for web, no? Could you also check a solution for Android native? |
Oh for sure! I focused on a solution that could work on web. For Android Native I tested BackHandler, practically the same solution but different handler (hardwareBackPress). Later when I'm on the PC I can share a video. |
Sounds good, thanks! I think that will be enough for Android and we can address any detail in the PR. Assigning @daordonez11 🚀 |
📣 @daordonez11 You have been assigned to this job by @marcochavezf! |
Hey guys! Thanks for the guidance and patience everyone. So finally seeing we got this through I wanted to open a discussion for reward on the issue. As discussed in this slack thread the scope of the issue changed and there were some additional tasks done to achieve the final goal. For your analysis of the reward I wanted to list all the executed tasks in the issue:
Finally thank you very much everyone for the opportunity and teachings it took some time but it is awesome to finally see this reaching main. And of course @mollfpr for the help with the final details to make it work smoothly! Of course, I'll be ready for any follow-up in terms of navigation, maybe some handling of events or navigation with the sign-in could be required in steps we didn't check. Still, nothing should be blocked with this implementation. |
Thanks @daordonez11 for your effort and I agree that this issue required exploration and back and forth discussion to reach to an optimal solution. Given the complexity of the task I think it would be ideal to double the bounty here. Thoughts @mountiny? (Since you were in the loop from the first attempt to solve the back navigation issue). |
Agreed |
Waiting for regression period to pass, then will pay w/double bounty! |
Hey there! @dylanexpensify this was deployed to prod on 23-08 I think regression period is already covered also I haven't seen any report yet 🫡. |
This seems to be ready for payment then #24083 We should add a test for this for sure @daordonez11 can you suggest test steps please to cover this thoroughly? |
Yeah for sure! I'll create something close to the BZ list and post it today |
|
Friendly bump @dylanexpensify |
Hey guys, @marcochavezf @mountiny do you know if maybe @dylanexpensify is OOO? It's already been 2 weeks after the expected payment date. |
He was at the conference we were launching so I think he fell behind these chores @dylanexpensify could you look into these ones please? |
Yes! On it - thanks for the ping! |
Hey @dylanexpensify hope everything went well at the conference! Maybe a new task will be required since the original job is no longer available https://www.upwork.com/jobs/~017a21cdc86c5eee7f |
Agree! On it now! |
Payment summary:
Upwork Job! Please apply! |
@dylanexpensify Applied, thanks! |
Applied too thanks @dylanexpensify |
Woot! |
Offers sent! |
payments sent! TY both!! |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Action Performed:
Screen.Recording.2023-06-09.at.18.41.52.mov
Expected Result:
It should redirect you to the public room
Actual Result:
It just redirects you the previous browser page
Workaround:
Click again on the link
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: v1.3.25-8
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos:
Expensify/Expensify Issue URL:
Issue reported by:
Slack conversation:
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: