Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.48k stars 2.82k forks source link

[$250] Workflow - Second approver disappears after editing and saving approval workflow #50294

Open IuliiaHerets opened 1 week ago

IuliiaHerets commented 1 week ago

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.45-2 Reproducible in staging?: Y Reproducible in production?: Y Email or phone of affected tester (no customers): applausetester+bm63@applause.expensifail.com Issue reported by: Applause Internal Team

Action Performed:

  1. Go to https://staging.new.expensify.com/
  2. Create a new workspace.
  3. Add multiple members, including Approver A, Approver B, and an employee.
  4. Go to "More Features" and enable workflow.
  5. Go to workflow and create an approval workflow:
    • The employee submits to Approver A.
    • Approver B is set as the second approver.
  6. Click on the approval workflow created in step 5.
  7. Click on "Expense From" and choose several members along with the employee, then save the changes.
  8. Reopen the same approval workflow.
  9. In "Expense From," deselect all members except for the employee, then save the configuration.

Expected Result:

The second approver (Approver B) should remain in the approval workflow after saving the changes.

Actual Result:

After saving the edited approval workflow, the second approver (Approver B) is removed from the workflow.

Workaround:

Unknown

Platforms:

Screenshots/Videos

https://github.com/user-attachments/assets/4ad435a4-5e23-4765-a7e6-80a4a61e7338

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021843144039278346707
  • Upwork Job ID: 1843144039278346707
  • Last Price Increase: 2024-10-07
Issue OwnerCurrent Issue Owner: @abdulrahuman5196
melvin-bot[bot] commented 1 week ago

Triggered auto assignment to @Christinadobrzyn (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 commented 1 week ago

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

Christinadobrzyn commented 1 week ago

Oh interesting - I can reproduce with the steps in the OP. I think this can be external

melvin-bot[bot] commented 1 week ago

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

melvin-bot[bot] commented 1 week ago

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

Christinadobrzyn commented 1 week ago

waiting on proposals

VickyStash commented 1 week ago

Hi, I'm Viktoryia from Callstack - expert contributor group - and I would like to work on this issue.

VickyStash commented 1 week ago

It looks like it's an API issue.

Params the app sends to the UpdateWorkspaceApproval API call during expenses members deselect (deselected viktoryia.kliushun+4@callstack.com user):

image

Here is the response I got from the API:

image

As you can see API besides updating viktoryia.kliushun+4@callstack.com user updated the viktoryia.kliushun+1@callstack.com (Approver 1) as well. It cleaned up his forwardsTo field => due to this Approver 2 got removed. So the fix would be updating UpdateWorkspaceApproval API call not to clear out forwardsTo field of the approver during employee deselect. Maybe Approver 1 (viktoryia.kliushun+1@callstack.com in this example) shouldn't be updated at all. But it's better to confirm with the BE team.

VickyStash commented 1 week ago

@abdulrahuman5196 What do you think about my suggestion above?

Christinadobrzyn commented 1 week ago

Hi @VickyStash thanks for joining us! I've added you to this GH. @abdulrahuman5196 if you can review the above proposal that would be great! TY!

VickyStash commented 4 days ago

@abdulrahuman5196 kind bump 🙂

abdulrahuman5196 commented 2 days ago

Will check today.

Christinadobrzyn commented 4 hours ago

just checking on this review @abdulrahuman5196 - thanks!