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.83k forks source link

[$250] Xero - Unable to change Xero bank account #46347

Closed lanitochka17 closed 1 month ago

lanitochka17 commented 2 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: 9.0.13-3 Reproducible in staging?: Y Reproducible in production?: Y If this was caught during regression testing, add the test name, ID and link from TestRail: N/A Issue reported by: Applause - Internal Team

Action Performed:

  1. Open the app
  2. Log in with a new account
  3. Click on FAB - New workspace
  4. Enable "Accounting" in the "More features" page.
  5. Navigate to "Accounting"
  6. Connect to Xero
  7. Navigate to Accounting - Export - Xero bank account
  8. Select any of the accounts

Expected Result:

I should be able to change Xero bank account

Actual Result:

I'm unable to change Xero bank account. After choosing a new one, the input clears and a few seconds later the default one appears again

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Add any screenshot/video evidence

https://github.com/user-attachments/assets/cb547d5b-63f2-49e2-b691-9a0e86fd67b4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01280db714da683fda
  • Upwork Job ID: 1817974646767184922
  • Last Price Increase: 2024-08-05
Issue OwnerCurrent Issue Owner: @suneox
melvin-bot[bot] commented 2 months ago

Triggered auto assignment to @puneetlath (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 2 months ago

@puneetlath 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 2 months ago

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

melvin-bot[bot] commented 2 months ago

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

melvin-bot[bot] commented 2 months ago

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

hungvu193 commented 2 months ago

Posted an update on Slack, this looks like a BE issue (https://expensify.slack.com/archives/C036QM0SLJK/p1722307989215409?thread_ts=1722273937.109659&cid=C036QM0SLJK)

melvin-bot[bot] commented 2 months ago

@puneetlath, @suneox Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

suneox commented 2 months ago

Posted an update on Slack, this looks like a BE issue (https://expensify.slack.com/archives/C036QM0SLJK/p1722307989215409?thread_ts=1722273937.109659&cid=C036QM0SLJK)

I have checked the UpdatePolicyConnectionConfiguration API, and it still returns the correct selected bank account. I’ve posted this to Slack to get more eyes on it.

https://github.com/user-attachments/assets/1dd07150-615b-42be-9574-0cc01f4aa7a9

m-natarajan commented 2 months ago

Issue is still reproducible by the original tester.

https://github.com/user-attachments/assets/12e3cd3b-5f4d-42b0-9029-f49fc7273034

melvin-bot[bot] commented 2 months ago

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

puneetlath commented 2 months ago

Ok, so it looks like this is an issue with the pusher event that gets sent after the action is taken. Not the API response itself. So I'm making it an internal issue and hot-pick in #wave-collect.

melvin-bot[bot] commented 2 months ago

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

melvin-bot[bot] commented 2 months ago

this issue was created 2 weeks ago. Are we close to a solution? Let's make sure we're treating this as a top priority. Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

melvin-bot[bot] commented 2 months ago

Still overdue 6 days?! Let's take care of this!

melvin-bot[bot] commented 2 months ago

Now this issue is 8 days overdue. Are you sure this should be a Daily? Feel free to change it!

melvin-bot[bot] commented 2 months ago

10 days overdue. I'm getting more depressed than Marvin.

melvin-bot[bot] commented 2 months ago

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

yuwenmemon commented 2 months ago

I think this might be a similar problem to https://github.com/Expensify/App/issues/45201 since this reset is coming from the integration server.

If I comment out the sync in updatePolicyConnectionConfiguration then this does not happen.

yuwenmemon commented 2 months ago

Oh, hmmm, but even after running a sync 5 min later, it still resets... that's not good 😬

yuwenmemon commented 2 months ago

Looks like these are the lines that are throwing an Invalid Connection Format and then we go to the defaults: https://github.com/Expensify/Integration-Server/blob/f2f3c959c4fbbae22e0a78d2ea450825b31429e9/src/expensify/beans/expensify/policy/integration/xero/XeroConfiguration.java#L368-L370

yuwenmemon commented 2 months ago

Oh hm looks like we're completely overwriting the config.export object when we update the bank account for some reason:

Screenshot 2024-08-19 at 12 36 19 PM
yuwenmemon commented 2 months ago

Oh yeah, it's because we use UpdatePolicyConnectionConfiguration, which performs a SET instead of a PATCH like UpdateManyPolicyConnectionConfigurations does.

yuwenmemon commented 2 months ago

I think I can at least move all sync updates to use individual commands, which will help with: https://github.com/Expensify/Expensify/issues/398342

cc @aldo-expensify

yuwenmemon commented 2 months ago

Actually I'll just make this easier and have Auth use JSONB_PATCH in both cases.

mvtglobally commented 1 month ago

Issue not reproducible during KI retests. (First week)

trjExpensify commented 1 month ago

Auth PR is on prod, can we close this?

yuwenmemon commented 1 month ago

Yes