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
2.99k stars 2.5k forks source link

[HOLD for payment 2024-05-22] Workspace - Unsupported browser notification appears on the Xero setup page (Android) #41512

Open m-natarajan opened 2 weeks ago

m-natarajan commented 2 weeks 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!


issue found when validating #41415 Version Number: 1.4.70-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: Email or phone of affected tester (no customers): Logs: https://stackoverflow.com/c/expensify/questions/4856 Expensify/Expensify Issue URL: Issue reported by: Applause internal Slack conversation:

Action Performed:

  1. Log in with a new expensifail account
  2. Create a workspace
  3. Enable "Accounting" on the WS settings page
  4. Navigate to "Accounting"
  5. Tap on the "Set up" button next to Xero

Expected Result:

The browser should be switched to a supported one or if it's not possible, the notification shouldn't appear for users.

Actual Result:

Unsupported browser notification appears on the Xero setup page.

Workaround:

unknown

Platforms:

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

Screenshots/Videos

Add any screenshot/video evidence

Bug6468935_1714661231507!Screenshot_20240502_164159_New_Expensify

https://github.com/Expensify/App/assets/38435837/39942580-3d51-48f4-a9f8-37c0dc22cda6

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01609688787adfdcff
  • Upwork Job ID: 1786384710813405184
  • Last Price Increase: 2024-05-03
  • Automatic offers:
    • gijoe0295 | Contributor | 0
Issue OwnerCurrent Issue Owner: @twisterdotcom
melvin-bot[bot] commented 2 weeks ago

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

m-natarajan commented 2 weeks ago

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

m-natarajan commented 2 weeks ago

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

twisterdotcom commented 2 weeks ago

Trying to recreate on iOS, my Android phone is at home. Added my test domain to the xero beta

twisterdotcom commented 2 weeks ago

Hmm, not an issue on iOS: IMG_1383

twisterdotcom commented 2 weeks ago

Confirmed: https://expensify.slack.com/archives/C01SKUP7QR0/p1714742239560959?thread_ts=1714741936.915729&cid=C01SKUP7QR0

melvin-bot[bot] commented 2 weeks ago

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

melvin-bot[bot] commented 2 weeks ago

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

gijoe0295 commented 2 weeks ago

Proposal

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

Unsupported browser notification appears on the Xero setup page.

What is the root cause of that problem?

Android's native WebView component is built on top of Chromium which is not supported by Xero.

Here's the user agent of Android WebView:

Mozilla/5.0 (Linux; Android 12; K wv) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.6367.113 Mobile Safari/537.36

Notice the word wv, it is to denote WebView. By removing the word wv, we could "trick" the target system that we're not using WebView and thus not chromium-webview.

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

We need to pass a "fake" userAgent to WebView component. We can follow the sample user agent provided here, use Safari for iOS and Chrome for Android.

Because WebView is used in multiple places, we can create a wrapper component to pass the userAgent.

What alternative solutions did you explore? (Optional)

I also discovered a problem that as this WebView is wrapped inside ConnectToXeroButton which is a children of ScrollView:

https://github.com/Expensify/App/blob/0a183687fac5f4b7049a7b11679eb9bb297a1e49/src/pages/workspace/accounting/PolicyAccountingPage.tsx#L330

That causes an issue on Android that the ScrollView would receive and handle the scroll action and thus user couldn't scroll the web content inside WebView. To fix this, we need to enable nestedScrollEnabled for the WebView.

jjcoffee commented 1 week ago

I'm going OOO so unassigning cc @twisterdotcom

gijoe0295 commented 1 week ago

@twisterdotcom Could you reassign another C+ here?

gijoe0295 commented 1 week ago

Tagging @lakchote here to help with C+ reassignment because @twisterdotcom was OOO and this is related to Xero release. This issue is easily reproducible and always happens on Android.

mananjadhav commented 1 week ago

@gijoe0295 โ€™s proposal looks good.

๐ŸŽ€ ๐Ÿ‘€ ๐ŸŽ€ C+ reviewed

melvin-bot[bot] commented 1 week ago

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

lakchote commented 1 week ago

@gijoe0295's proposal LGTM.

melvin-bot[bot] commented 1 week ago

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

Offer link Upwork job Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review ๐Ÿง‘โ€๐Ÿ’ป Keep in mind: Code of Conduct | Contributing ๐Ÿ“–

mananjadhav commented 1 week ago

@gijoe0295 Any updates on when the PR would be ready?

twisterdotcom commented 5 days ago

Hello, I'm back! Thanks @lakchote for assigning a new C+.

melvin-bot[bot] commented 3 days ago

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

melvin-bot[bot] commented 3 days ago

The solution for this issue has been :rocket: deployed to production :rocket: in version 1.4.73-7 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-05-22. :confetti_ball:

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

melvin-bot[bot] commented 3 days 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: