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

[$500] Request Money - Category edit page shown for normal money request (betweem 2 users) #28192

Closed
3 of 6 tasks
kbecciv opened this issue Sep 25, 2023 · 17 comments
Closed
3 of 6 tasks
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors

Comments

@kbecciv
Copy link

kbecciv commented Sep 25, 2023

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:

  1. Create a money request with user (no workspace)
  2. Go to that money request page
  3. Append /edit/category to url
  4. Category is visible

Expected Result:

Category shouldn't be shown for 1:1 money request, user should see page is not found with appropriate message

Actual Result:

Category edit page shown for normal money request (between 2 users)

Workaround

Unknown

Platforms:

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

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: 1.3.74.0
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: Any additional supporting documentation

Screen.Recording.2023-09-24.at.10.14.28.AM.mov
Recording.4767.mp4

Expensify/Expensify Issue URL:
Issue reported by: @BhuvaneshPatil
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1695530860289029

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01445341bcc011416f
  • Upwork Job ID: 1706399640115785728
  • Last Price Increase: 2023-10-02
@kbecciv kbecciv added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Sep 25, 2023
@melvin-bot melvin-bot bot changed the title Request Money - Category edit page shown for normal money request (betweem 2 users) [$500] Request Money - Category edit page shown for normal money request (betweem 2 users) Sep 25, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 25, 2023

Triggered auto assignment to @CortneyOfstad (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@melvin-bot
Copy link

melvin-bot bot commented Sep 25, 2023

Job added to Upwork: https://www.upwork.com/jobs/~01445341bcc011416f

@melvin-bot
Copy link

melvin-bot bot commented Sep 25, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Sep 25, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 25, 2023

Triggered auto assignment to @dylanexpensify (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.

@melvin-bot
Copy link

melvin-bot bot commented Sep 25, 2023

Triggered auto assignment to Contributor-plus team member for initial proposal review - @Ollyws (External)

@RichardPickman
Copy link

RichardPickman commented Sep 25, 2023

Proposal

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

Category modal opens in one-to-one money request when redirecting to /edit/category.

What is the root cause of that problem?

Modal opens whenever path satisfies mask /edit/category

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

Add additional check on request type to open category list.

if (fieldToEdit === CONST.EDIT_REQUEST_FIELD.CATEGORY) {

What alternative solutions did you explore? (Optional)

Remove either Category modal block or CATEGORY constant from request due to unnecessary categories field inside of a one-to-one money request

@neonbhai
Copy link
Contributor

neonbhai commented Sep 25, 2023

Proposal

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

Catergory page editable for dms

What is the root cause of that problem?

We have not checked if the category is editable in EditRequestCategoryPage

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

We should wrap the EditRequestCategoryPage here with FullPageNotFoundView like we do in other places in the app.

What alternative solutions did you explore? (Optional)

xx

@RichardPickman
Copy link

RichardPickman commented Sep 25, 2023

Proposal

[Updated]link to proposal

@BhuvaneshPatil
Copy link
Contributor

@kbecciv Can you please add the proposal from slack here.

@kbecciv
Copy link
Author

kbecciv commented Sep 26, 2023

Proposal by: @BhuvaneshPatil
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1695530860289029

Proposal

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

We can access edit category page using link for 1:1 request, but the category feature is only for workspace money requests
https://expensify.slack.com/archives/C01GTK53T8Q/p1695530938132669

What is the root cause of that problem?

We don't have any check in EditRequestCategoryPage for allowing that page to be shown for 1:1 money requests.

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

we check for showing category in MoneyRequestView

const shouldShowCategory = isPolicyExpenseChat && Permissions.canUseCategories(betas) && (transactionCategory || OptionsListUtils.hasEnabledOptions(lodashValues(policyCategories)));

We shall have same check for EditRequestCategoryPage.
We shall wrap above component using FullPageNotFoundView and use same logic as we are using in MoneyRequestView.
To access all this information we need to add some props and pass few from parent component.

What alternative solutions did you explore? (Optional)

We can also add FullPageNotFoundView in

if (fieldToEdit === CONST.EDIT_REQUEST_FIELD.CATEGORY) {
return (
<EditRequestCategoryPage
defaultCategory={transactionCategory}
policyID={lodashGet(report, 'policyID', '')}
onSubmit={(transactionChanges) => {
let updatedCategory = transactionChanges.category;
// In case the same category has been selected, do reset of the category.
if (transactionCategory === updatedCategory) {
updatedCategory = '';
}
editMoneyRequest({category: updatedCategory});
}}
/>
);
}

The advantage of this is that some information is already available and we don't need to add props for them.

@RichardPickman
Copy link

Proposal

[UPDATE] #28192 (comment) , Added permalink by rushatgabhane suggestion.

@melvin-bot melvin-bot bot added the Overdue label Sep 28, 2023
@dylanexpensify dylanexpensify removed their assignment Sep 28, 2023
@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Sep 28, 2023
@Ollyws
Copy link
Contributor

Ollyws commented Oct 2, 2023

The first proposal from slack by @BhuvaneshPatil looks good to me.
🎀👀🎀 C+ reviewed

Edit: Already being fixed by #28165

@melvin-bot melvin-bot bot removed the Overdue label Oct 2, 2023
@melvin-bot
Copy link

melvin-bot bot commented Oct 2, 2023

Triggered auto assignment to @cead22, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@BhuvaneshPatil
Copy link
Contributor

BhuvaneshPatil commented Oct 2, 2023

cool, thanks @Ollyws

@Ollyws
Copy link
Contributor

Ollyws commented Oct 2, 2023

Actually, this one seems to be being fixed by #28165 cc: @cead22

@melvin-bot
Copy link

melvin-bot bot commented Oct 2, 2023

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@Ollyws
Copy link
Contributor

Ollyws commented Oct 2, 2023

This is now fixed on staging, we're good to close this issue.

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. Daily KSv2 External Added to denote the issue can be worked on by a contributor Help Wanted Apply this label when an issue is open to proposals by contributors
Projects
None yet
Development

No branches or pull requests

8 participants