-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
[$250] mWeb - Workspace - Opens "Hmm it's not here" when tapping system back button #49854
Comments
Triggered auto assignment to @jliexpensify ( |
@jliexpensify FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors |
I can't repro this on 9.0.41-2 (Pixel 6) |
Issue is still reproducible on the latest build 9.0.44-10
Bug6618542_1727536595923.Screen_Recording_20240928_180655.mp4 |
Edited by proposal-police: This proposal was edited at 2024-10-05 17:48:57 UTC. ProposalPlease restate the problem that we are trying to solve in this issue.Navigating back with the device back button disrupts the URL when navigating from pages like “Members” and “Categories" etc. on narrow layouts. What is the root cause of that problem?This happens specifically for the However, on narrow layouts, the route is As mentioned here, workspace routes can give an improper path with getStateFromPath. In this case, the path is App/src/libs/Navigation/linkingConfig/getAdaptedStateFromPath.ts Lines 373 to 383 in 99f280b
We replace the nested path by mutating the state directly here. App/src/libs/Navigation/linkingConfig/replacePathInNestedState.ts Lines 6 to 14 in 99f280b
When the path changes with the device back button, React Navigation needs to adjust its internal state. If the state is mutated during this process, like directly setting a route’s value as above, it can lead to unpredictable behaviour including extra popState events. It should not be mutated.
What changes do you think we should make in order to solve the problem?We can create a new object and return it from function replacePathInNestedState(state: PartialState<NavigationState<RootStackParamList>>, path: string) {
const found = findFocusedRoute(state);
if (!found) {
return;
}
const updatedRoute = {
...found,
path: path,
};
const newState = {
...state,
routes: state.routes.map(route =>
route === found ? updatedRoute : route
),
};
return newState;
} and use that here:
as state = replacePathInNestedState(state, path); What alternative solutions did you explore? (Optional)As far as I understand, the path issue with the ‘/’ at the start is handled here:
I have not found any other cases where getPathFromState does not return the correct path. The getPathWithoutPolicyID functions also check with a regex in the format of /w/, which I have not found anywhere in ROUTES. So, we might consider removing this function replacePathInNestedState completely. |
@jliexpensify Whoops! This issue is 2 days overdue. Let's get this updated quick! |
Job added to Upwork: https://www.upwork.com/jobs/~021843764334226859970 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @ntdiary ( |
During the review, the inspection of the above proposal may take another day. 🤔 |
Hi, @adamgrzybowski, do you remember which specific issue the When we open a workspace from the |
Oh, for some reason I misread the
as normalizedPath .
So, I could not identify where the '/' was being removed. |
I'm still digging in and verifying. 😄 |
@ntdiary @jliexpensify this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks! |
Hey @ntdiary, sorry for the delay. Unfortunately, I don't remember the exact case. It was probably something like going back (with the in app button) to this page causing a wrong path in the browser's URL bar if the path wasn't corrected in the state. |
@adamgrzybowski, thank you! :) |
@c3024, we have a workspace switcher, and the Based on my investigation, the issue seems more related to a mismatch between two paths in the memory history. Instead of having App/src/libs/Navigation/linkTo/index.ts Line 136 in 8ab4792
const {adaptedState, metainfo} = getAdaptedStateFromPath(path, linkingConfig.config, false); Additionally, I’m working on testing more accurate and comprehensive cases, so that we can move forward with more confidence. :) |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: 9.0.40
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/5007250
Issue reported by: Applause - Internal Team
Action Performed:
Employee's side
Admin's side
Expected Result:
The user returns to the Workspace settings page
Actual Result:
The "Hmm... it's not here" page is displayed:
Hmm... it's not here
Oops, this page cannot be found
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Bug6617565_1727454588873.it_s_not_here-admin_s_side.mp4.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @ntdiaryThe text was updated successfully, but these errors were encountered: