App icon indicating copy to clipboard operation
App copied to clipboard

[$250] Xero - Infinite spinner on "Waiting for imported data to load" when connecting to Xero

Open trjExpensify opened this issue 11 months ago • 12 comments

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: v9.0.72-0 Reproducible in staging?: Y Reproducible in production?: Y If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: N/A If this was caught during regression testing, add the test name, ID and link from TestRail: Email or phone of affected tester (no customers): [email protected] Logs: here (internal).

Couldn't get valid connection data ~~ integration: 'xero' policyID: '75A37FFA15152001' data: 'is_temp_logs2fc8f4db-2e06-4013-adab-8c26a017556f.log' class: 'ExpensifyException' msg: 'Invalid connection configuration' code: '410'
Couldn't load Xero connection data ~~ policyID: '75A37FFA15152001' class: 'ExpensifyException' msg: 'Invalid connection configuration' code: '410'

Expensify/Expensify Issue URL: Issue reported by: @trjExpensify Slack conversation (hyperlinked to channel name): #convert thread.

Action Performed:

  1. Sign-up for a new account on new.expensify.com
  2. Choose "Manage my team's expenses" > 1-10 > Xero
  3. Connect the workspace to Xero (validate the account and add a 2FA code)
  4. Observe the infinite loading spinner for "Waiting for imported data to load"
  5. Navigate away from the Accounting page and back again
  6. Observe the connection has loaded.

Expected Result:

You shouldn't have to navigate away and back for the connection details to appear.

Actual Result:

Infinite loading spinner.

Workaround:

Yes, navigate away and back again.

Platforms:

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

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

Screenshots/Videos

https://github.com/user-attachments/assets/eab931d2-0759-4385-98aa-c9728e7fc989

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021864838632082983296
  • Upwork Job ID: 1864838632082983296
  • Last Price Increase: 2024-12-06
Issue OwnerCurrent Issue Owner: @eVoloshchak

trjExpensify avatar Dec 06 '24 01:12 trjExpensify

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

melvin-bot[bot] avatar Dec 06 '24 01:12 melvin-bot[bot]

Current assignee @trjExpensify is eligible for the Bug assigner, not assigning anyone new.

melvin-bot[bot] avatar Dec 06 '24 01:12 melvin-bot[bot]

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

melvin-bot[bot] avatar Dec 06 '24 01:12 melvin-bot[bot]

CC: @hungvu193 @lakchote as you both have experience in this domain!

trjExpensify avatar Dec 06 '24 01:12 trjExpensify

I can reproduce. It looks like policy?.connections is empty so the loading indicator is still visible, possibly BE issue, our Pusher event didn't send the connections data:

Screenshot 2024-12-06 at 10 15 04

hungvu193 avatar Dec 06 '24 03:12 hungvu193

Interesting! @lakchote would this perhaps have something to do with turning off OnyxUpdates for Classic? I didn't think it would, because shouldHandleOnyxUpdates is set to true for job source NewDot.

https://github.com/Expensify/Integration-Server/pull/7934/files https://github.com/Expensify/Web-Expensify/pull/42292/files

trjExpensify avatar Dec 06 '24 11:12 trjExpensify

I've followed the exact testing steps outlined in the issue and couldn't reproduce.

The error Invalid connection configuration comes when there are required properties missing from the Xero's configuration keys such as mappings, importTrackingCategories, export...

@francoisl do you have any hints on when this edge case could happen?

lakchote avatar Dec 06 '24 16:12 lakchote

I've followed the exact testing steps outlined in the issue and couldn't reproduce.

Interesting that both Hans and I could repro. 🤔 I can try again.

trjExpensify avatar Dec 06 '24 18:12 trjExpensify

Yep, same again. I'm using the 1Password credentials for SRAM Test Xero.

https://github.com/user-attachments/assets/f9f99ec3-3eb4-4efe-bfe3-3ff8caec00f9

trjExpensify avatar Dec 06 '24 18:12 trjExpensify

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

melvin-bot[bot] avatar Dec 09 '24 09:12 melvin-bot[bot]

I've followed the exact testing steps outlined in the issue and couldn't reproduce.

@lakchote was this staging or dev only?

trjExpensify avatar Dec 09 '24 10:12 trjExpensify

I've followed the exact testing steps outlined in the issue and couldn't reproduce.

@lakchote was this staging or dev only?

I tried on dev.

I've just tried on staging and I now have a Bad gateway error when trying to connect, do you have one too?

I have this error, the one you reported in the issue: image

I've tried with SRAM Test Xero and Xero QA Account.

Edit: I've managed to connect successfully on an @expensifail.com account.

And stumbled upon the Waiting for imported data to load error.

lakchote avatar Dec 09 '24 11:12 lakchote

I've just tried on staging and I now have a Bad gateway error when trying to connect, do you have one too?

I didn't get this one. Just an infinite loader on "Waiting for imported data to load"...

trjExpensify avatar Dec 09 '24 15:12 trjExpensify

There has been no new changes related to Xero's code nor Integration-Server recently, I'll need to investigate it further.

lakchote avatar Dec 09 '24 17:12 lakchote

@eVoloshchak, @trjExpensify Huh... This is 4 days overdue. Who can take care of this?

melvin-bot[bot] avatar Dec 11 '24 09:12 melvin-bot[bot]

@lakchote is going to investigate this a bit, Melv.

trjExpensify avatar Dec 11 '24 09:12 trjExpensify

I've retested the whole flow on another account on staging and the issue remains.

Same on dev, I actually get the same issue now.

The Onyx update for the policy is never sent until we go back to reenter which calls OpenPolicyProfilePage: image

@francoisl are you aware of any changes related to Onyx/Pusher in Integration-Server?

lakchote avatar Dec 11 '24 12:12 lakchote

I tested and was able to repro on dev too. I'm not aware of any changes in Integration-Server, though in this case I imagine the Onyx updates should come from Auth when we save the connection details in the policy?

francoisl avatar Dec 12 '24 00:12 francoisl

@trjExpensify this issue seems to affect QBO too (on staging).

@flodnv looks like you've handled the new jsonWriteMode parameter.

It's set to log: https://github.com/Expensify/Web-Expensify/blob/f37f9df20cf6b6384f74f857fb48263ea3abb140/lib/Auth.php#L3628

As a result, we are not updating the NVP for the policy's connection (Logsearch): image

Auth's code: https://github.com/Expensify/Auth/blob/3c8d06af87e1c683170e5ccbf10cbd1988e93edc/auth/command/SavePolicy.cpp#L470-L475

Is that intended?

EDIT 13/12/24: Nvm, it doesn't seem to be the root cause of the issue.

lakchote avatar Dec 12 '24 15:12 lakchote

@eVoloshchak, @trjExpensify 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

melvin-bot[bot] avatar Dec 13 '24 09:12 melvin-bot[bot]

📣 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] avatar Dec 13 '24 16:12 melvin-bot[bot]

Nvm, it doesn't seem to be the root cause of the issue.

Agreed, log means that we do this: https://github.com/Expensify/Auth/blob/4345e99bff32f89093e2ad742274f0d4ee62e883/auth/command/SavePolicy.cpp#L483

flodnv avatar Dec 13 '24 16:12 flodnv

Asked for external eyes on this here: https://expensify.slack.com/archives/C03TQ48KC/p1734108170237789

lakchote avatar Dec 13 '24 16:12 lakchote

@lakchote should we assign you here given that you're investigating it?

trjExpensify avatar Dec 16 '24 11:12 trjExpensify

@lakchote should we assign you here given that you're investigating it?

Yes, I've assigned myself.

lakchote avatar Dec 17 '24 06:12 lakchote

PR is under review.

lakchote avatar Dec 17 '24 09:12 lakchote

Great stuff!

trjExpensify avatar Dec 17 '24 12:12 trjExpensify

@eVoloshchak, @trjExpensify, @lakchote Whoops! This issue is 2 days overdue. Let's get this updated quick!

melvin-bot[bot] avatar Dec 24 '24 09:12 melvin-bot[bot]

@eVoloshchak, @trjExpensify, @lakchote Huh... This is 4 days overdue. Who can take care of this?

melvin-bot[bot] avatar Dec 26 '24 09:12 melvin-bot[bot]

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

melvin-bot[bot] avatar Dec 30 '24 09:12 melvin-bot[bot]