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.56k stars 2.9k forks source link

[HOLD for payment 2024-10-17] [$250] Desktop - Xero - Mac - Expensify opens in web browser (Safari) after logging in with Xero credentials #49342

Closed IuliiaHerets closed 3 weeks ago

IuliiaHerets commented 1 month 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.36-1 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/4971703&group_by=cases:section_id&group_id=309134&group_order=asc Issue reported by: Applause Internal Team

Action Performed:

Precondition: Account has 2FA enabled.

  1. Open the app
  2. Log in with a Gmail account
  3. Click on FAB - New workspace
  4. Enable "Accounting" in the "More features" page.
  5. Navigate to "Accounting"
  6. Click on the "Connect" button next to Xero
  7. Enter Xero credentials and click on the "Allow access" button after selecting othe organisation

    Expected Result:

    The app should be opened.

Actual Result:

Expensify opens in web browser (Safari) after logging in with Xero credentials.

Workaround:

Unknown

Platforms:

Screenshots/Videos

https://github.com/user-attachments/assets/c4de9158-7607-4976-b380-661f29caf0fd

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021838081379137473899
  • Upwork Job ID: 1838081379137473899
  • Last Price Increase: 2024-09-30
  • Automatic offers:
    • shubham1206agra | Reviewer | 104272545
Issue OwnerCurrent Issue Owner: @VictoriaExpensify
melvin-bot[bot] commented 1 month ago

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

IuliiaHerets commented 1 month ago

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

IuliiaHerets commented 1 month ago

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

melvin-bot[bot] commented 1 month ago

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

VictoriaExpensify commented 1 month ago

I've recreated the issue and do agree that it isn't ideal - ideally we would route the user back to the app not web-browser

melvin-bot[bot] commented 1 month ago

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

melvin-bot[bot] commented 1 month ago

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

melvin-bot[bot] commented 1 month ago

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

VictoriaExpensify commented 1 month ago

Still waiting for proposals

shubham1206agra commented 1 month ago

@VictoriaExpensify Can you post this issue in expert contributors room? Since this issue requires changes in navigation.

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

VictoriaExpensify commented 1 month ago

Done! Thanks @shubham1206agra

https://expensify.slack.com/archives/C04878MDF34/p1727775491684449

VickyStash commented 1 month ago

Hi, I'm Viktoryia from Callstack - expert contributor group - and I would like to work on this issue.

VickyStash commented 1 month ago

Unfortunately, I have some problems with the Safari browser, which I'm going to resolve within an ~ hour.

But at first glance at the video, it looks like Safari tries to open the desktop app after a successful Xero connection, but due to built in security checks it asks about allowance to open the desktop app.

image

I'm not sure that we can get rid of this default browser check, but I guess if you once select Always allow it should resolve the issue. And just pressing Allow should also open the desktop app.

You can see the similar security check and similar behaviour in the Google Chrome as well. I needed to allow the desktop app to be opened:

https://github.com/user-attachments/assets/bcbd93d7-00dc-4f84-b8e7-1d6a5c0990e6

VickyStash commented 1 month ago

I was able to get the same behavior in the Safari, and as I mentioned above - pressing Allow opens the desktop app. But I'm not sure that the expected screen is opened on the desktop.

https://github.com/user-attachments/assets/ad735e51-77aa-4812-a2bd-a192d5f32c31

@VictoriaExpensify Could you confirm what screen should be opened after navigating to the desktop app?

melvin-bot[bot] commented 1 month ago

@VictoriaExpensify @shubham1206agra 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!

VickyStash commented 1 month ago

@shubham1206agra Could you please take a look at my messages above and let me know what you think?

shubham1206agra commented 1 month ago

@VickyStash I think /connection-complete should be on full screen (not exposing the LHN) and it should not give the prompt for desktop app.

VickyStash commented 1 month ago

@VickyStash I think /connection-complete should be on full screen (not exposing the LHN) and it should not give the prompt for desktop app.

Just to confirm the expected behaviour @shubham1206agra @VictoriaExpensify :

  1. User click on the "Connect" button next to Xero in the Desktop app

  2. User connects to the Xero and in the web browser sees the fullscreen /connection-complete screen. image

  3. User manually goes back to the desktop app. The app isn't opened automatically and the browser doesn't give the prompt for desktop app.

shubham1206agra commented 1 month ago

Yes, this is expected flow.

VickyStash commented 1 month ago

I've also found the Connection Page PR and it describes the same flow as mentioned above. Btw it works as expected now if user is not authorized in the web version:

https://github.com/user-attachments/assets/ab5545bd-6d25-4405-a7a4-7b95e1b50f3f

So I need to fix it when the user is authorized on the web.

VickyStash commented 1 month ago

Proposal

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

If the user connects to Xero from the desktop and logged into the app on web, after connection:

image

But the Connection complete screen should be on full screen (not exposing the LHN) and it should not give the prompt for the desktop app.

What is the root cause of that problem?

  1. We don't check for the Connection complete screen while promoting the user to the desktop from the web.
  2. We pass the wrong screen options to SCREENS.CONNECTION_COMPLETE screen.

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

  1. Update the check inside the DeeplinkWrapper to check for the connection complete route and don't navigate the user to the desktop app if the user is on this page.

    const isConnectionCompleteRoute = window.location.pathname.replace('/', '') === ROUTES.CONNECTION_COMPLETE;

    https://github.com/Expensify/App/blob/9627f5f8da6542b42a7f2eb9125dc82eea083740/src/components/DeeplinkWrapper/index.website.tsx#L66-L76

  2. Update options passed to SCREENS.CONNECTION_COMPLETE to screenOptions.fullScreen https://github.com/Expensify/App/blob/9627f5f8da6542b42a7f2eb9125dc82eea083740/src/libs/Navigation/AppNavigator/AuthScreens.tsx#L562-L566

shubham1206agra commented 1 month ago

Lets go with @VickyStash's proposal

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

melvin-bot[bot] commented 1 month ago

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

VickyStash commented 1 month ago

I've prepared the PR for the review. But there is a problem with eslint check in one of the files wich requires to get rid of withOnyx usage. At the same time useOnyx usage causing regression, more details can be found here: https://github.com/Expensify/App/pull/50071#issuecomment-2389065901.

UPD: There is a separate issue https://github.com/Expensify/App/issues/49103 to migrate AuthScreens to useOnyx. So, I think the failing check can be skipped in the PR.

shubham1206agra commented 1 month ago

@AndrewGable Please do the assignment here Thanks

melvin-bot[bot] commented 1 month ago

๐Ÿ“ฃ @shubham1206agra ๐ŸŽ‰ 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

melvin-bot[bot] commented 1 month ago

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

melvin-bot[bot] commented 1 month ago

The solution for this issue has been :rocket: deployed to production :rocket: in version 9.0.47-4 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-10-17. :confetti_ball:

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

melvin-bot[bot] commented 1 month 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:

VictoriaExpensify commented 4 weeks ago

Hey @shubham1206agra - can you please complete the checklist and I'll process your payment. Thanks!

melvin-bot[bot] commented 3 weeks ago

@AndrewGable, @VickyStash, @VictoriaExpensify, @shubham1206agra Whoops! This issue is 2 days overdue. Let's get this updated quick!

shubham1206agra commented 3 weeks ago

Need to do checklist here

shubham1206agra commented 3 weeks 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:

VictoriaExpensify commented 3 weeks ago

Payment Summary: Contributor: @VickyStash - Contractor Contributor+: @shubham1206agra paid $250 via Upwork