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.12k stars 2.61k forks source link

[$250] Distance - Route in distance editor doesn't load after fresh sign in #44156

Open izarutskaya opened 2 weeks ago

izarutskaya 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!


Version Number: 9-0-0-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/4620930 Logs: https://stackoverflow.com/c/expensify/questions/4856 Issue reported by: Applause-Internal team

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to workspace chat.
  3. Submit a distance expense.
  4. Go to transaction thread.
  5. Click Distance.
  6. Note that the green route is shown.
  7. Sign out and back in
  8. Go to the transaction thread in Step 3.
  9. Click Distance.

Expected Result:

The route will load

Actual Result:

The route does not load

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

https://github.com/Expensify/App/assets/26260477/339b183d-d86e-4f03-8b62-2af4067d61de

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01a809b3d1bd11c266
  • Upwork Job ID: 1807822900424921117
  • Last Price Increase: 2024-07-01
Issue OwnerCurrent Issue Owner: @thesahindia
melvin-bot[bot] commented 2 weeks ago

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

izarutskaya commented 2 weeks ago

We think this issue might be related to the #collect project.

melvin-bot[bot] commented 1 week ago

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

johncschuster commented 1 week ago

@neil-marcellini I'm curious about your thoughts here. Would you expect the green route to persist after the user clears their cache?

johncschuster commented 1 week ago

@neil-marcellini Assigning to you just to make sure my question is on your radar. Please feel free to drop off after!

neil-marcellini commented 6 days ago

We shouldn't really report bugs which include a debug only feature like clearing the cache. I was tempted to close the issue, but first I checked if a similar problem was reproducible after signing out. It looks like that does in fact present a real issue, so I'm going to update the description. I'm happy to stay on to manage this externally.

https://github.com/Expensify/App/assets/26260477/339b183d-d86e-4f03-8b62-2af4067d61de

melvin-bot[bot] commented 6 days ago

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

melvin-bot[bot] commented 6 days ago

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

izarutskaya commented 3 days ago

The team discovered the route also does not generate after changing waypoints in offline mode.

https://github.com/Expensify/App/assets/115492554/8ceb7e34-aba5-4bf1-b308-025220fc3005

bernhardoj commented 3 days ago

Proposal

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

The distance green line route disappears after re-login.

What is the root cause of that problem?

The green line route is coming from the transaction route coordinate data. https://github.com/Expensify/App/blob/a84f68eeb1f72d0ca3308a4bdc9dc78e59a46d2e/src/components/DistanceRequest/DistanceRequestFooter.tsx#L112

The coordinate data is retrieved from GetRoute/Draft API. However, the data (routes) isn't saved on the BE and lost when we re-login as pointed out in here.

The GetRoute/Draft API is only called when the waypoints are changed. https://github.com/Expensify/App/blob/a84f68eeb1f72d0ca3308a4bdc9dc78e59a46d2e/src/pages/iou/request/step/IOURequestStepDistance.tsx#L93

But because we don't change it, the coordinate data stays empty and the route green line is gone.

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

Trigger the GetRoute/Draft API if the routes data is missing.

const shouldFetchRoute = (!transaction?.routes || isRouteAbsentWithoutErrors || haveValidatedWaypointsChanged) && !isLoadingRoute && Object.keys(validatedWaypoints).length > 1;
melvin-bot[bot] commented 3 days ago

@johncschuster, @neil-marcellini, @thesahindia Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

melvin-bot[bot] commented 2 days ago

@johncschuster @neil-marcellini @thesahindia 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!

thesahindia commented 2 days ago

@bernhardoj's proposal looks good to me!

🎀 👀 🎀 C+ reviewed

melvin-bot[bot] commented 2 days ago

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