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

Expense - Expense fields are editable after the workspace is deleted #51164

Closed
8 tasks done
IuliiaHerets opened this issue Oct 21, 2024 · 11 comments
Closed
8 tasks done
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2

Comments

@IuliiaHerets
Copy link

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.51-1
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/5102033
Email or phone of affected tester (no customers): applausetester [email protected]
Issue reported by: Applause Internal Team

Action Performed:

  1. Go to staging.new.expensify.com
  2. Create a workspace.
  3. Submit an expense.
  4. Delete the workspace.
  5. Go to the transaction thread.
  6. Edit any fields.

Expected Result:

The expense fields should be disabled and not be editable after the workspace is deleted.

Actual Result:

The expense fields are not disabled and are editable after the workspace is deleted.

Workaround:

Unknown

Platforms:

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6640786_1729500881172.20241021_164805.mp4

View all open jobs on GitHub

@IuliiaHerets IuliiaHerets added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Oct 21, 2024
Copy link

melvin-bot bot commented Oct 21, 2024

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

@IuliiaHerets
Copy link
Author

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

@IuliiaHerets
Copy link
Author

@muttmuure 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

@NJ-2020
Copy link
Contributor

NJ-2020 commented Oct 21, 2024

Edited by proposal-police: This proposal was edited at 2024-10-21 09:46:50 UTC.

Proposal

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

xpense - Expense fields are editable after the workspace is deleted

What is the root cause of that problem?

Inside canEditFieldOfMoneyRequest we don't check if the workspace is archived

function canEditFieldOfMoneyRequest(reportAction: OnyxInputOrEntry<ReportAction>, fieldToEdit: ValueOf<typeof CONST.EDIT_REQUEST_FIELD>): boolean {

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

We need to check if the report is archived

if (isArchivedRoom(report)) {
    return false;
}

Note: We need some changes on the BE side to return correct private_isArchived value

What alternative solutions did you explore? (Optional)

@ChavdaSachin
Copy link
Contributor

ChavdaSachin commented Oct 21, 2024

#50352 (comment)
This was my Proposal for exactly similar issue, and I suggested a complete solution where we might be able to completely solve this GH and any similar future issues we might face rather then simple situation based temporary solution.

@FitseTLT
Copy link
Contributor

This might be expected as open expense requests are not archived when the workspace is archived. Tagging @trjExpensify for context.

@trjExpensify
Copy link
Contributor

The workspace being deleted doesn't mean you can't edit the details of the expenses on the expense report if it's in a state you could edit them prior to deletion. What you shouldn't be able to do is 1) add new expenses to it or 2) submit, approve or pay it. Those restrictions/action buttons are being worked on in another issue though.

@melvin-bot melvin-bot bot added the Overdue label Oct 23, 2024
@muttmuure
Copy link
Contributor

Closing as expected behavior

@aldo-expensify
Copy link
Contributor

The workspace being deleted doesn't mean you can't edit the details of the expenses on the expense report if it's in a state you could edit them prior to deletion. What you shouldn't be able to do is 1) add new expenses to it or 2) submit, approve or pay it. Those restrictions/action buttons are being worked on in another issue though.

What is the purpose of allowing editing the expense in an archived workspace? There is a new related issue here: #52896 where the backend doesn't update correctly an expense that belongs to an archived room.

I'm just asking because it may be easier to prevent this in the frontend. Is it a real user case that someone may want to edit an expense in an archived workspace?

@trjExpensify
Copy link
Contributor

What is the purpose of allowing editing the expense in an archived workspace?

Backwards compatibility with OldDot at this juncture, mainly. Expense reports don't change state when a policy is deleted (i.e gets moved to "closed"). We don't prevent editing expense details on the expense reports outside of the usual report state restrictions, nor prevent commenting on them, nor most actions really. We do prevent onward actions on the policy like approve/pay, and give you the ability to move the expense report to another workspace to continue those. The latter of which we're hoping to bring to NewDot soon as well.

@aldo-expensify
Copy link
Contributor

I see, thanks! then the expected behaviour in #52896 is correct in expecting the backend to do the modification correctly 🙇

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
Projects
None yet
Development

No branches or pull requests

7 participants