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.42k stars 2.8k forks source link

[HOLD for payment 2024-07-24] [$250] Accounting - Workspace admins aren't lised as a "Preferred exporter" #44150

Closed lanitochka17 closed 2 months ago

lanitochka17 commented 3 months 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: 1.4.86-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: https://expensify.testrail.io/index.php?/tests/view/4653117&group_by=cases:section_id&group_id=309134&group_order=asc Issue reported by: Applause - Internal Team

Action Performed:

  1. Navigate to https://staging.new.expensify.com/
  2. Log in with an expensifail account
  3. Create a workspace
  4. Enable Accounting
  5. Connect to Xero
  6. Add an expensifail member as an admin
  7. Navigate to Workspace settings - Accounting - Export - Preferred exporter repro only if i add admin after i connect to Xero. Not repro when i manually sync it

Expected Result:

Workspace admins should be listed

Actual Result:

Workspace admins aren't lised as a "Preferred exporter" Reproducible only if add admin after connected to Xero. Not repro when manually sync it

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Add any screenshot/video evidence

https://github.com/Expensify/App/assets/78819774/2431dcda-517e-472d-8674-448aa4934b43

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01b398eb305ddcbb3e
  • Upwork Job ID: 1805402957868224386
  • Last Price Increase: 2024-07-02
Issue OwnerCurrent Issue Owner: @greg-schroeder
melvin-bot[bot] commented 3 months ago

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

lanitochka17 commented 3 months ago

@greg-schroeder 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

lanitochka17 commented 3 months ago

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

melvin-bot[bot] commented 3 months ago

@greg-schroeder Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

melvin-bot[bot] commented 3 months ago

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

melvin-bot[bot] commented 3 months ago

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

greg-schroeder commented 3 months ago

Sending through for proposals

daledah commented 3 months ago

Proposal

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

Workspace admins aren't lised as a "Preferred exporter" Reproducible only if add admin after connected to Xero. Not repro when manually sync it

What is the root cause of that problem?

When a user is updated role to Admin, the entry for that user in the policy employeeList doesn't contain the email https://github.com/Expensify/App/blob/d7d7739f3b3e6862411f29dc6c8c4b0362b459ff/src/libs/actions/Policy/Member.ts#L386

In Xero exporter check https://github.com/Expensify/App/blob/d7d7739f3b3e6862411f29dc6c8c4b0362b459ff/src/pages/workspace/accounting/xero/export/XeroPreferredExporterSelectPage.tsx#L45, we filter out employee without emails

-> The issue happens

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

Add email in employeeList entry when changing member role, adding member, ...

Or update getAdminEmployees such that it will use the key of the employeeList as email (because employeeList was keyed by emails), if email doesn't exist in the entry.

We could need to add logic to 'add @expensify.sms` to email if it's phone number, in those places.

The same solution could apply to other integrations, if the issue exists there.

What alternative solutions did you explore? (Optional)

None

greg-schroeder commented 3 months ago

Bump @alitoshmatov for proposal review!

melvin-bot[bot] commented 3 months ago

@greg-schroeder, @alitoshmatov Whoops! This issue is 2 days overdue. Let's get this updated quick!

melvin-bot[bot] commented 3 months ago

πŸ“£ It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? πŸ’Έ

allroundexperts commented 3 months ago

Taking over. I'll review the proposals today.

shubham1206agra commented 3 months ago

@allroundexperts Please fix the same for other integrations too.

allroundexperts commented 3 months ago

@shubham1206agra Can you guide us on what other integrations we should look after? The proposed solution works well for Xero.

allroundexperts commented 3 months ago

Thanks for your proposal @daledah. Your RCA is correct and the solution proposed works as well. When raising a PR, please make sure that it works for the following integrations as well in addition to Xero:

  1. NetSuite
  2. QuickBooks

Let's go with @daledah's proposal.

πŸŽ€ πŸ‘€ πŸŽ€ C+ reviewed

melvin-bot[bot] commented 3 months ago

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

allroundexperts commented 3 months ago

@jasperhuangg FYI, @daledah's proposal fixed this for offline case only. Can you please check if we're sending the email from the backend once the request succeeds?

shubham1206agra commented 3 months ago

Thanks for your proposal @daledah. Your RCA is correct and the solution proposed works as well. When raising a PR, please make sure that it works for the following integrations as well in addition to Xero:

1. NetSuite

2. QuickBooks

Let's go with @daledah's proposal.

πŸŽ€ πŸ‘€ πŸŽ€ C+ reviewed

@allroundexperts I have a question here. I don't think adding email https://github.com/Expensify/App/blob/d7d7739f3b3e6862411f29dc6c8c4b0362b459ff/src/libs/actions/Policy/Member.ts#L386 will fix the issue as email was probably already there and an onyx update will not remove that if not specified in the optimistic update.

melvin-bot[bot] commented 3 months ago

Current assignee @jasperhuangg is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.

daledah commented 3 months ago

email was probably already there and an onyx update will not remove that if not specified in the optimistic update.

@shubham1206agra I just checked again and email was not there both when adding members and changing the roles (that can also be validated in code here). If you see email's there, could you provide a video/steps to reproduce that?

Thanks

shubham1206agra commented 3 months ago

email was probably already there and an onyx update will not remove that if not specified in the optimistic update.

@shubham1206agra I just checked again and email was not there both when adding members and changing the roles (that can also be validated in code here). If you see email's there, could you provide a video/steps to reproduce that?

Thanks

@daledah Ok your RCA was right, but the removal of email was intentional as far as I can tell (I am not 100% sure).

Or update getAdminEmployees such that it will use the key of the employeeList as email (because employeeList was keyed by emails), if email doesn't exist in the entry.

Do this, as this key is guaranteed to be email.

daledah commented 3 months ago

Do this, as this key is guaranteed to be email.

@shubham1206agra Yup sure, thanks for the feedback!

@jasperhuangg Could you assign me here so I can start on this? (Here's the C+ review)

melvin-bot[bot] commented 3 months ago

@greg-schroeder @jasperhuangg this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

greg-schroeder commented 2 months ago

bump @jasperhuangg on confirming the contributor assignment!

melvin-bot[bot] commented 2 months ago

πŸ“£ @daledah You have been assigned to this job! Please apply to the Upwork job and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review πŸ§‘β€πŸ’» Once you apply to this job, your Upwork ID will be stored and you will be automatically hired for future jobs! Keep in mind: Code of Conduct | Contributing πŸ“–

jasperhuangg commented 2 months ago

Agree with @daledah's proposal, sorry for the delay, was OOO!

greg-schroeder commented 2 months ago

No sweat, thanks!

daledah commented 2 months ago

@allroundexperts this PR is ready for review

melvin-bot[bot] commented 2 months ago

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

melvin-bot[bot] commented 2 months ago

The solution for this issue has been :rocket: deployed to production :rocket: in version 9.0.7-8 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2024-07-24. :confetti_ball:

For reference, here are some details about the assignees on this issue:

melvin-bot[bot] commented 2 months ago

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:

greg-schroeder commented 2 months ago

Payment summary:

Contributor: @daledah - $250 - Offer sent via Upwork C+: @allroundexperts - $250 - You can make a manual request via ND

greg-schroeder commented 2 months ago

@daledah can you apply to the upwork job or link your upwork profile here so I can send you an offer/pay you?

https://www.upwork.com/jobs/~01b398eb305ddcbb3e

melvin-bot[bot] commented 2 months ago

Payment Summary

Upwork Job

BugZero Checklist (@greg-schroeder)

greg-schroeder commented 2 months ago

@daledah it says your Upwork profile is no longer available. so you're going to create a valid upwork account and apply to this job in order for me to pay you.

greg-schroeder commented 2 months ago

bump @daledah

daledah commented 2 months ago

@daledah it says your Upwork profile is no longer available

@greg-schroeder Hey I'm resolving this issue, I'll give an update on this early next week!

daledah commented 2 months ago

@daledah it says your Upwork profile is no longer available

@greg-schroeder All good now! Please help send an offer to my profile https://www.upwork.com/freelancers/~0138d999529f34d33f

greg-schroeder commented 2 months ago

Sent @daledah

daledah commented 2 months ago

@greg-schroeder I accepted the offer, thx!