Repository navigation
[HOLD for payment 2024-10-25] [$250] QAB - Destination opens in the background when starting QAB flow #46352
Description
Activity
- addedDailyKSv2KSv2BugSomething is broken. Auto assigns a BugZero manager.Something is broken. Auto assigns a BugZero manager.
on Jul 27, 2024 Triggered auto assignment to @kevinksullivan (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.@kevinksullivan 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
We think that this bug might be related to #wave-collect - Release 1
Edited by proposal-police: This proposal was edited at 2024-08-09 22:16:08 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
QAB - Destination opens in the background when starting QAB flow
What is the root cause of that problem?
Here:
App/src/libs/Navigation/linkingConfig/getAdaptedStateFromPath.ts
Lines 177 to 196 in 98d8a5a
if (rhpNavigator) { // Routes // - matching bottom tab // - matching root route for rhp // - found rhp // This one will be defined because rhpNavigator is defined. const focusedRHPRoute = findFocusedRoute(state); const routes = []; if (focusedRHPRoute) { let matchingRootRoute = getMatchingRootRouteForRHPRoute(focusedRHPRoute); const isRHPScreenOpenedFromLHN = focusedRHPRoute?.name && RHP_SCREENS_OPENED_FROM_LHN.includes(focusedRHPRoute?.name as RHPScreenOpenedFromLHN); // This may happen if this RHP doens't have a route that should be under the overlay defined. if (!matchingRootRoute || isRHPScreenOpenedFromLHN) { metainfo.isCentralPaneAndBottomTabMandatory = false; metainfo.isFullScreenNavigatorMandatory = false; // If matchingRootRoute is undefined and it's a narrow layout, don't add a report screen under the RHP. matchingRootRoute = matchingRootRoute ?? (!isNarrowLayout ? {name: SCREENS.REPORT} : undefined); } When the target navigation is RHP from the bottom tab navigator (LHN), as in the case of creating an IOU request, the
isRHPScreenOpenedFromLHNdoes not includeSCREENS.MONEY_REQUEST.CREATE. As a result, theisRHPScreenOpenedFromLHNcondition evaluates to false, and since there is amatchingRootRoute, the metainfo values forisCentralPaneAndBottomTabMandatoryandisFullScreenNavigatorMandatoryremain true. Consequently, the navigation state adapts to include the central pane route (the matching root route, which in this case is the report screen).If the user clicks on the FAB and selects "Submit Expense," the
matchingRootRoutewill be undefined because the report ID in the URL/route is generated optimistically. This change will update the metainfo to:
metainfo.isCentralPaneAndBottomTabMandatory = false; metainfo.isFullScreenNavigatorMandatory = false;What changes do you think we should make in order to solve the problem?
we should include the iou request create focused route, (in this case "manual") add
SCREENS.MONEY_REQUEST.CREATE.MANUAL/CONST.TAB_REQUEST_MANUALinRHP_SCREENS_OPENED_FROM_LHN, also we must check other related screens that can be opened from LHN, the scan and distance tab_request, etc...Alternative solution
I think there will be many screens to include as well.
I believe a better fix is:
App/src/libs/Navigation/linkingConfig/getAdaptedStateFromPath.ts
Lines 187 to 191 in 98d8a5a
if (focusedRHPRoute) { let matchingRootRoute = getMatchingRootRouteForRHPRoute(focusedRHPRoute); const isRHPScreenOpenedFromLHN = focusedRHPRoute?.name && RHP_SCREENS_OPENED_FROM_LHN.includes(focusedRHPRoute?.name as RHPScreenOpenedFromLHN); // This may happen if this RHP doens't have a route that should be under the overlay defined. if (!matchingRootRoute || isRHPScreenOpenedFromLHN) { to make the
matchingRootRoutehas correct value.The
getMatchingRootRouteForRHPRoutewill always include the report screen if there is areportIDparameter in the route:App/src/libs/Navigation/linkingConfig/getAdaptedStateFromPath.ts
Lines 151 to 156 in 98d8a5a
// check for valid reportID in the route params // if the reportID is valid, we should navigate back to screen report in CPN const reportID = (route.params as Record<string, string | undefined>)?.reportID; if (ReportConnection.getAllReports()?.[`${ONYXKEYS.COLLECTION.REPORT}${reportID}`]) { return {name: SCREENS.REPORT, params: {reportID}}; } However, the route that must include the report screen is the route that starts with
/r/. Other routes do not need to include the report screen. Therefore, the code changes should be:// sometimes route path start with `/` and sometimes not. just to make sure here. if (route?.path.indexOf('/r/') === 0 || route?.path.indexOf('r/') === 0) { const reportID = (route.params as Record < string, string | undefined > )?.reportID; if (!!reportID && ReportConnection.getAllReports()?.[`${ONYXKEYS.COLLECTION.REPORT}${reportID}`]) { return {name: SCREENS.REPORT, params: {reportID}}; } }
Other routes which really require report of reportID param to be openened first can be included in exception list.
@kevinksullivan Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
@kevinksullivan Eep! 4 days overdue now. Issues have feelings too...
Reproduced. I think this is a polish item for collect.
- addedExternalAdded to denote the issue can be worked on by a contributorAdded to denote the issue can be worked on by a contributor
on Aug 1, 2024 - changed the title
[-]QAB - Destination opens in the background when starting QAB flow[/-][+][$250] QAB - Destination opens in the background when starting QAB flow[/+]on Aug 1, 2024 103 remaining items
Reviewinglabel has been removed, please complete the "BugZero Checklist".The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.50-8 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2024-10-25. 🎊
For reference, here are some details about the assignees on this issue:
- @Guccio163 does not require payment (Contractor)
- @aimane-chnaif requires payment (Needs manual offer from BZ)
- @tsa321 requires payment automatic offer (Contributor)
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
- [@aimane-chnaif] The PR that introduced the bug has been identified. Link to the PR:
- [@aimane-chnaif] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
- [@aimane-chnaif] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
- [@aimane-chnaif] Determine if we should create a regression test for this bug.
- [@aimane-chnaif] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
- [@sonialiap] Link the GH issue for creating/updating the regression test once above steps have been agreed upon: https://github.com/Expensify/Expensify/issues/439489
Payment summary:
- @aimane-chnaif $250 paid in upwork ✔️
- @tsa321 $250 paid in upwork ✔️
- The PR that introduced the bug has been identified. Link to the PR: Fix: three not found view v2 #41665
- The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment: [HOLD for payment 2024-10-25] [$250] QAB - Destination opens in the background when starting QAB flow #46352 (comment)
- A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion: N/A
Regression Test Proposal
- Complete the manual expense submission flow.
- Click on FAB, then select QAB to open the expense submission flow.
- Click the back button in the header.
- For small screens (Android and iOS), verify that the LHN screen opens instead of the report screen. For wide screens, ensure that the submit expense flow functions properly.
- Repeat steps 1–4 for the scan and distance expense submission flows.
Reacted by Sonia Liapounova@sonialiap I am still using upwork
Reacted by Sonia Liapounova@aimane-chnaif oh sorry! I saw that you're whitelisted for ND payments. Offer sent in Upwork
@dangrous @sonialiap Be sure to fill out the Contact List!
Metadata
Metadata
Labels
Type
Projects
- StatusShow more project fieldsDone
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.13-3
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Issue reported by: Applause - Internal Team
Action Performed:
Expected Result:
App will return to LHN after closing QAB flow
Actual Result:
App will return to workspace chat (destination) after closing QAB flow
The destination (in this case, workspace chat) opens in the background when starting QAB flow
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
Bug6554078_1722025287007.ScreenRecording_07-27-2024_04-17-08_1.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @aimane-chnaif