Skip to content
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 2024-07-24] [HOLD for payment 2024-07-10] iOS - Hold - Back button on transaction thread returns to Hold - Reason page after holding it #44423

Closed
3 of 6 tasks
m-natarajan opened this issue Jun 26, 2024 · 13 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Engineering Weekly KSv2

Comments

@m-natarajan
Copy link

m-natarajan commented Jun 26, 2024

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


issue found when validating #43618
Version Number: 9.0.2-0
Reproducible in staging?: y
Reproducible in production?: n
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
Expensify/Expensify Issue URL:
Issue reported by: applause internal team
Slack conversation:

Action Performed:

  1. Launch New Expensify app.
  2. Go to workspace chat.
  3. Submit an expense.
  4. Go to transaction thread.
  5. Tap 3-dot menu > Hold.
  6. Enter reason > Save.
  7. Tap on the back button.

Expected Result:

Back button on transaction thread will not return to Hold - Reason page.

Actual Result:

Back button on transaction thread returns to Hold - Reason page after holding the expense.

Workaround:

unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6524578_1719351617865.RPReplay_Final1719351372.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @strepanier03
@m-natarajan m-natarajan added DeployBlockerCash This issue or pull request should block deployment Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. DeployBlocker Indicates it should block deploying the API labels Jun 26, 2024
Copy link

melvin-bot bot commented Jun 26, 2024

Triggered auto assignment to @strepanier03 (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.

Copy link

melvin-bot bot commented Jun 26, 2024

Triggered auto assignment to @hayata-suenaga (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels Jun 26, 2024
Copy link
Contributor

👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

@m-natarajan
Copy link
Author

@hayata-suenaga 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

@m-natarajan
Copy link
Author

We think that this bug might be related to #wave-collect - Release 1

@bernhardoj
Copy link
Contributor

Proposal

Please re-state the problem that we are trying to solve in this issue.

Pressing back button after hold arrived at the hold reason page again.

What is the root cause of that problem?

After submitting the hold reason, we navigate to the backTo param.

const navigateBack = () => {
Navigation.navigate(backTo);
};

backTo in this case is the transaction thread report. It should navigate back to the transaction thread because it exists on the stack, but the backTo route keeps being pushed to the nav stack because it's detected that the params of the backTo route is different with the params of the topmost central pane.

if (isCentralPaneName(action.payload.name) && (isTargetScreenDifferentThanCurrent || areParamsDifferent)) {

If the transaction thread report route is /r/123, then the backTo is also /r/123, but somehow the comparison fails.

const areParamsDifferent =
actionParams?.screen === SCREENS.REPORT
? getTopmostReportId(rootState) !== getTopmostReportId(stateFromPath)
: !shallowCompare(
omitBy(topmostCentralPaneRoute?.params as Record<string, unknown> | undefined, (value) => value === undefined),
omitBy(actionParams?.params as Record<string, unknown> | undefined, (value) => value === undefined),
);

const actionParams: ActionPayloadParams = action.payload.params;

First, the actionParams?.screen === SCREENS.REPORT returns false. Second, the shallowCompare also returns false. That's because both actionParams?.screen and actionParams?.params are undefined. This happened after we simplify the root navigator.

Report screen was previously inside a CentralPaneNavigator, but it's not anymore now.

What changes do you think we should make in order to solve the problem?

Replace the usages of actionParams?.screen with action.payload.name and actionParams?.params with action.payload.params.

const isTargetScreenDifferentThanCurrent = !!(!topmostCentralPaneRoute || topmostCentralPaneRoute.name !== (actionParams?.screen ?? action.payload.name));
const areParamsDifferent =
actionParams?.screen === SCREENS.REPORT
? getTopmostReportId(rootState) !== getTopmostReportId(stateFromPath)
: !shallowCompare(
omitBy(topmostCentralPaneRoute?.params as Record<string, unknown> | undefined, (value) => value === undefined),
omitBy(actionParams?.params as Record<string, unknown> | undefined, (value) => value === undefined),
);

if (actionParams?.screen === SCREENS.SEARCH.CENTRAL_PANE && actionParams?.params && policyID) {
(actionParams.params as Record<string, string | undefined>).policyIDs = policyID;
}

@WojtekBoman
Copy link
Contributor

Hi! I'll take a look at this issue

@luacmartins
Copy link
Contributor

This was fixed by #44444 and CPed to staging. We're good to close since it was a regression.

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Jul 3, 2024
@melvin-bot melvin-bot bot changed the title iOS - Hold - Back button on transaction thread returns to Hold - Reason page after holding it [HOLD for payment 2024-07-10] iOS - Hold - Back button on transaction thread returns to Hold - Reason page after holding it Jul 3, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jul 3, 2024
Copy link

melvin-bot bot commented Jul 3, 2024

Reviewing label has been removed, please complete the "BugZero Checklist".

Copy link

melvin-bot bot commented Jul 3, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.3-7 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-07-10. 🎊

Copy link

melvin-bot bot commented Jul 3, 2024

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:

  • [@luacmartins] The PR that introduced the bug has been identified. Link to the PR:
  • [@luacmartins] 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:
  • [@luacmartins] 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:
  • [@luacmartins] Determine if we should create a regression test for this bug.
  • [@luacmartins] 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.
  • [@strepanier03] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Jul 17, 2024
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2024-07-10] iOS - Hold - Back button on transaction thread returns to Hold - Reason page after holding it [HOLD for payment 2024-07-24] [HOLD for payment 2024-07-10] iOS - Hold - Back button on transaction thread returns to Hold - Reason page after holding it Jul 17, 2024
Copy link

melvin-bot bot commented Jul 17, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.7-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-07-24. 🎊

Copy link

melvin-bot bot commented Jul 17, 2024

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:

  • [@luacmartins] The PR that introduced the bug has been identified. Link to the PR:
  • [@luacmartins] 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:
  • [@luacmartins] 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:
  • [@luacmartins] Determine if we should create a regression test for this bug.
  • [@luacmartins] 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.
  • [@strepanier03] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Engineering Weekly KSv2
Projects
None yet
Development

No branches or pull requests

7 participants