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

Category-Saving GL & payroll code directed to category list instead of specific category #47399

Open
4 of 6 tasks
izarutskaya opened this issue Aug 14, 2024 · 16 comments
Open
4 of 6 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Engineering Reviewing Has a PR in review Weekly KSv2

Comments

@izarutskaya
Copy link

izarutskaya commented Aug 14, 2024

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: 9.0.20
Reproducible in staging?: Y
Reproducible in production?: N
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/4856835
Logs: https://stackoverflow.com/c/expensify/questions/4856
Issue reported by: Applause-Internal team

Action Performed:

  1. Go to https://staging.new.expensify.com/
  2. Tap profile icon -- workspaces-- workspace
  3. Tap more features -- enable report field
  4. Tap category
  5. Tap on a category
  6. Rename the category android save it
  7. Note user directed to specfic category page
  8. Enter GL code & payroll code and save it
  9. Note user directed to category list instead of specific category page
  10. Edit GL code & payroll code and save it
  11. Note user directed to category list instead of specific category page

Expected Result:

Saving GL & payroll code must be directed to specific category page.

Actual Result:

Saving GL & payroll code directed to category list instead of specific category page

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

Bug6571828_1723625332057.xh.mp4

View all open jobs on GitHub

@izarutskaya izarutskaya added DeployBlockerCash This issue or pull request should block deployment Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Aug 14, 2024
Copy link

melvin-bot bot commented Aug 14, 2024

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

Copy link

melvin-bot bot commented Aug 14, 2024

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

@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels Aug 14, 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.

@izarutskaya
Copy link
Author

We think this issue might be related to the #vip-vsb

@BhuvaneshPatil
Copy link
Contributor

BhuvaneshPatil commented Aug 14, 2024

PR which added these changes - #46617

Proposal

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

Upon saving GL and payroll code, we are directed to category list instead of specific category page

What is the root cause of that problem?

We are using dismissModal()

const editGLCode = useCallback(
(values: FormOnyxValues<typeof ONYXKEYS.FORMS.WORKSPACE_CATEGORY_FORM>) => {
const newGLCode = values.glCode.trim();
if (newGLCode !== glCode) {
Category.setPolicyCategoryGLCode(route.params.policyID, categoryName, newGLCode);
}
Navigation.dismissModal();
},
[categoryName, glCode, route.params.policyID],
);

const editPayrollCode = useCallback(
(values: FormOnyxValues<typeof ONYXKEYS.FORMS.WORKSPACE_CATEGORY_FORM>) => {
const newPayrollCode = values.payrollCode.trim();
if (newPayrollCode !== payrollCode) {
Category.setPolicyCategoryPayrollCode(route.params.policyID, categoryName, newPayrollCode);
}
Navigation.dismissModal();
},
[categoryName, payrollCode, route.params.policyID],
);

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

We should use goBack() with appropriate fallback route.

With using fallback route to particular category, even when user refreshes it will redirect to correct page.

Navigation.goBack(ROUTES.WORKSPACE_CATEGORY_SETTINGS.getRoute(policyId, categoryName));
Screen.Recording.2024-08-14.at.4.35.02.PM.mov
Screen.Recording.2024-08-14.at.4.39.49.PM.mov

What alternative solutions did you explore? (Optional)

@BhuvaneshPatil
Copy link
Contributor

@allroundexperts In PR it was converted from goBack() to dismissModal(). We can consider for upgrade pages but places pages where we change values. I am not getting that. Can you please explain. Thanks

@allroundexperts
Copy link
Contributor

@BhuvaneshPatil I think it will be safe to change it on the pages where we change values. We can give it a try.

@allroundexperts
Copy link
Contributor

Btw this is really an minor issue when compared with the host of issues that #46617 solves. I think we can demote this to be not a blocker.

@youssef-lr
Copy link
Contributor

youssef-lr commented Aug 15, 2024

@allroundexperts would you like to submit a quick fix?

@allroundexperts
Copy link
Contributor

Sure, please assign this to me and I will raise a PR tomorrow.

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Aug 16, 2024
@allroundexperts
Copy link
Contributor

PR: #47593

@abdulrahuman5196
Copy link
Contributor

@youssef-lr / @isabelastisser Could you kindly add me as a C+ here for working on the PR review?

@isabelastisser
Copy link
Contributor

@abdulrahuman5196 @allroundexperts I see PR is merged; when is payment due?

@abdulrahuman5196
Copy link
Contributor

It shows 3 weeks ago this PR was pushed to staging. But no production comment. I think automation didn't comment here.

@youssef-lr I am assuming this is already pushed to production. Correct me if wrong? And when was that?

@abdulrahuman5196
Copy link
Contributor

The PR that introduced the bug has been identified. Link to the PR:
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:
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:

#46617

Determine if we should create a regression test for this bug.

Yes.

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.

  1. Go to https://staging.new.expensify.com/
  2. Tap profile icon -- workspaces-- workspace
  3. Tap more features -- enable report field
  4. Tap category
  5. Tap on a category
  6. Rename the category android save it
  7. Note user directed to specfic category page
  8. Enter GL code & payroll code and save it
  9. Note user directed to category list instead of specific category page
  10. Edit GL code & payroll code and save it
  11. Verify that saving GL & payroll code must be directed to specific category page.

@abdulrahuman5196
Copy link
Contributor

It shows 3 weeks ago this PR was pushed to staging. But no production comment. I think automation didn't comment here.

@youssef-lr I am assuming this is already pushed to production. Correct me if wrong? And when was that?

@youssef-lr / @isabelastisser Could you kindly confirm here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. Engineering Reviewing Has a PR in review Weekly KSv2
Projects
None yet
Development

No branches or pull requests

7 participants