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

[Awaiting Payment Sept 9th] [$250] Xero - "Can't connect to Xero." error message appears briefly before connecting #44148

Closed lanitochka17 closed 2 weeks 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/4653112&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 a new expensifail account
  3. Create a workspace
  4. Enable Accounting
  5. Navigate to Workspace settings - Accounting
  6. Connect to Xero

Expected Result:

I should be able to connect without any error messages

Actual Result:

"Can't connect to Xero." error message appears briefly before connecting. Affects Gmail and expensifail accounts too.

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/943516af-d8e7-4e96-90d1-e5d13ecbba40

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01c4b2bfe4b91b5ac9
  • Upwork Job ID: 1805137190641025234
  • Last Price Increase: 2024-08-08
  • Automatic offers:
    • alitoshmatov | Reviewer | 103274174
Issue OwnerCurrent Issue Owner: @kadiealexander
melvin-bot[bot] commented 3 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.

lanitochka17 commented 3 months ago

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

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

melvin-bot[bot] commented 3 months ago

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

melvin-bot[bot] commented 3 months ago

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

alitoshmatov commented 3 months ago

Waiting for proposals

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? ๐Ÿ’ธ

melvin-bot[bot] commented 3 months ago

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

alitoshmatov commented 3 months ago

Still waiting for proposals

melvin-bot[bot] commented 3 months ago

@kadiealexander @alitoshmatov 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!

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? ๐Ÿ’ธ

melvin-bot[bot] commented 2 months ago

@kadiealexander, @alitoshmatov Eep! 4 days overdue now. Issues have feelings too...

kadiealexander commented 2 months ago

Requested a retest here.

kbecciv commented 2 months ago

Reproducible on build 9.0.5-7.

https://github.com/Expensify/App/assets/93399543/cc9b16b6-0d33-4832-8295-21dcd9f1b343

kadiealexander commented 2 months ago

Still not overdue.

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? ๐Ÿ’ธ

melvin-bot[bot] commented 2 months ago

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

kadiealexander commented 2 months ago

Not overdue.

kadiealexander commented 2 months ago

I can still reproduce:

https://github.com/user-attachments/assets/fd0fd920-6ddf-4004-a70e-9bcf04d60277

@alitoshmatov do you think this can be fixed entirely on the front end?

melvin-bot[bot] commented 2 months ago

@kadiealexander @alitoshmatov this issue is now 4 weeks old, please consider:

Thanks!

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? ๐Ÿ’ธ

melvin-bot[bot] commented 2 months ago

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

kadiealexander commented 2 months ago

@alitoshmatov bump on my question above.

kubabutkiewicz commented 2 months ago

Hi! I am Jakub from Callstack - expert contributor group. Iโ€™d like to work on this issue.

@kadiealexander Can I get some credentials to connect to Xero? And are there any other requirements to reproduce that issue?

kadiealexander commented 2 months ago

Hi Jakub! That's all that is needed to reproduce. Do you have access to our 1password environment?

melvin-bot[bot] commented 2 months ago

๐Ÿ“ฃ @alitoshmatov ๐ŸŽ‰ An offer has been automatically sent to your Upwork account for the Reviewer role ๐ŸŽ‰ Thanks for contributing to the Expensify app!

Offer link Upwork job

kubabutkiewicz commented 2 months ago

@kadiealexander no, I dont have

trjExpensify commented 2 months ago

@kubabutkiewicz try to connect to Xero and then choose the Xero demo company option.

trjExpensify commented 2 months ago

I'm not sure if that option is there anymore, but if not.. just start a 30 day free trial: https://www.xero.com/uk/signup/

trjExpensify commented 2 months ago

Also, @nkdengineer @brunovjk as you guys worked on this PR very recently, I'm curious for your thoughts here as well: https://github.com/Expensify/App/pull/45041

kubabutkiewicz commented 2 months ago

Hi ! @trjExpensify thanks for that I was able to reproduce that. For me this seems to be a problem with syncing with backend. So the logic for showing red brick road indicator is that we finished syncing and policy connection isSuccessful is false so it look like that !isSyncInProgress && policy?.connections?.[connectionName]?.lastSync?.isSuccessful === false. And for isSyncInProgress we are checking that POLICY_CONNECTION_SYNC_PROGRESS onyx key have stageInProgress property different than jobDone value. The problem is happening when stageInProgress is jobDone but in policy looks like that

{
    connections: {
        xero: {
            lastSync: {
                isSuccessful: false
            }
        }
    }
}

So stageInProgress is changing quicker to jobDone than changing isSuccessful to true. So there is somewhere reace condition I guess. Do we have any other indicator that syncing is still in progress? and do we know what is this key isConnected in xero.lasySync object ? As its always set to false

image
trjExpensify commented 2 months ago

@lakchote is out, but I think this might be related: https://github.com/Expensify/App/issues/46445#issuecomment-2257209333

CC: @yuwenmemon @NikkiWines (@aldo-expensify as well for vis).

kubabutkiewicz commented 2 months ago

Hey hey, during debugging I noticed different bug. When I was redirected to Xero page and when clicked Allow access I got 500 error during redirect back to Expensify which looked like that

image

But on Connections page it looks like I am connected but the Onyx data looks like I shouldn't be connected

image
kubabutkiewicz commented 2 months ago

The problem here is that backend sometimes sending pusher events in different order. At the first screenshot we see that first pusher event is for policyConnectionSyncProgress which says that its jobDone is sent before policy object which says isSuccessful: true but on the second screenshot that the order of those two messages is opposite, and this is making this issue. So in my opinion we should make that backend will sent those messages always in the same order. Because policyConnectionSyncProgress is our indicator that syncing is still in progress or no.

image

order1

trjExpensify commented 2 months ago

Is the bug still reproducible now @NikkiWines's IS PR is on prod?

kadiealexander commented 2 months ago

Requested a retest here

kavimuru commented 2 months ago

Bug is still reproducible.

https://github.com/user-attachments/assets/2b7cae6b-b854-4a7f-812d-77a91888ad57

trjExpensify commented 2 months ago

Interesting, @kubabutkiewicz did you get this TypeError like QA did?

image
kubabutkiewicz commented 2 months ago

I will check it @trjExpensify but did you saw my message before ?https://github.com/Expensify/App/issues/44148#issuecomment-2260056390

trjExpensify commented 2 months ago

Right, but I don't recall you mentioning the TypeError for target and I'm wondering if that's an "evolution" of the bug, since @NikkiWines's IS changes.

kubabutkiewicz commented 1 month ago

@trjExpensify Right now for me connecting to Xero is not working at all ๐Ÿค” is it a known issue?

https://github.com/user-attachments/assets/cc01a1f2-e25c-4e71-95b0-f4be1e7848bc

melvin-bot[bot] commented 1 month ago

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

trjExpensify commented 1 month ago

Ah, @hungvu193 you've run into this 500 before right?

hungvu193 commented 1 month ago

Ah, @hungvu193 you've run into this 500 before right?

Yep, but I can't reproduce it now

trjExpensify commented 1 month ago

IIRC, you resolved it by disconnecting or something?

hungvu193 commented 1 month ago

Yeah, I disconnected and reconnected again. Also this bug Xero - "Can't connect to Xero." error message appears briefly before connecting also happened on SageIntacct. I faced it while testing https://github.com/Expensify/App/pull/45251 I mentioned it here

trjExpensify commented 1 month ago

You mean also happened with QBO, right? Yup, we should discuss somewhere in realtime to get to the bottom of it: https://expensify.slack.com/archives/C036QM0SLJK/p1723545827358999?thread_ts=1723483552.155049&cid=C036QM0SLJK

hungvu193 commented 1 month ago

You mean also happened with QBO, right?

Ah yes. My bad

hungvu193 commented 1 month ago

I agree with @kubabutkiewicz 's comment, we should fix this from BE. cc @arosiclair