Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HOLD for payment 2023-09-12] [$500] [Distance] - App crashes while using distance feature #26558

Closed
1 of 6 tasks
lanitochka17 opened this issue Sep 2, 2023 · 53 comments
Closed
1 of 6 tasks
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor

Comments

@lanitochka17
Copy link

lanitochka17 commented Sep 2, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Issue found when executing PR #25980

Action Performed:

  1. Launch app
  2. Turn off mobile date
  3. Tap fab
  4. Tap Request money
  5. Tap Distance
  6. Enter Start address and save
  7. Enter Finish address and save (make sure you hit save)
  8. Turn on mobile data

Expected Result:

The app must generate map for address entered

Actual Result:

In online, the app crashes while using distance feature

Workaround:

Unknown

Platforms:

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

  • Android / native
  • Android / Chrome
  • iOS / native
  • iOS / Safari
  • MacOS / Chrome / Safari
  • MacOS / Desktop

Version Number: 1.3.62-1

Reproducible in staging?: Yes

Reproducible in production?: No

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

Notes/Photos/Videos: Any additional supporting documentation

Bug6186208_20230902_160813.mp4
test.mp4

Expensify/Expensify Issue URL:

Issue reported by: Applause - Internal Team

Slack conversation:

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~014a7eeceb0e8a9b8a
  • Upwork Job ID: 1698183373609881600
  • Last Price Increase: 2023-09-03
  • Automatic offers:
    • fedirjh | Reviewer | 26478908
    • pradeepmdk | Contributor | 26478909
@lanitochka17 lanitochka17 added the DeployBlockerCash This issue or pull request should block deployment label Sep 2, 2023
@OSBotify
Copy link
Contributor

OSBotify commented Sep 2, 2023

👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open StagingDeployCash deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.

@melvin-bot
Copy link

melvin-bot bot commented Sep 2, 2023

Triggered auto assignment to @hayata-suenaga (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

@JmillsExpensify JmillsExpensify self-assigned this Sep 3, 2023
@hayata-suenaga hayata-suenaga added the External Added to denote the issue can be worked on by a contributor label Sep 3, 2023
@melvin-bot melvin-bot bot changed the title Distance - App crashes while using distance feature [$500] Distance - App crashes while using distance feature Sep 3, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 3, 2023

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Sep 3, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 3, 2023

Current assignee @JmillsExpensify is eligible for the External assigner, not assigning anyone new.

@melvin-bot
Copy link

melvin-bot bot commented Sep 3, 2023

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

@b4s36t4
Copy link
Contributor

b4s36t4 commented Sep 3, 2023

This issue only happens only when we click on Save button. Because we've wrapped the WaypointEditor component with a From when we click on save only string get's saved. No lat & lognitude is being saved.

If we're offline we save lat & lag as null which is causing the app to crash. We seems to handle the null values but not the app though.

So What I want to confirm is even if we go online because we've saved lat & lan as null or 0 route markers won't be pointed which results in no route paint on the map.

what shall we do here? when user become online fetch the lat & lng for the waypoints which have lat & lng null values??

if not doesn't that cause an issue itself??.

This save button also raises an issue flow follows this way

Open Requst Money
Select a waypoint from the autocomplete input
Select the same waypoint but now use the save button
Select finish address
Observe only one marker is showing in the app (Finish marker since we have lat & lng for the waypoint).

Whenever we click on Save there's no lat & lng.

Shall we just remove the save button?? That reduces the 90% of effort.

Screenshot 2023-09-03 at 11 35 27 AM

@b4s36t4
Copy link
Contributor

b4s36t4 commented Sep 3, 2023

@shubham1206agra
Copy link
Contributor

https://developers.google.com/maps/documentation/places/web-service/search-text#:~:text=A%20Text%20Search%20returns%20information,bias%20that%20has%20been%20set. We can use this API if we're planning to refetch lat & lng once back online.

This requires backend changes

@b4s36t4
Copy link
Contributor

b4s36t4 commented Sep 3, 2023

I don't think so. Backend handles places API using in a proxy way.

@hayata-suenaga
Copy link
Contributor

okay I feel like the easy fix for now is to disable the save button when offline...

@b4s36t4
Copy link
Contributor

b4s36t4 commented Sep 3, 2023

Proposal

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

Distance - App crashes while using distance feature

What is the root cause of that problem?

lat & lng being null causing the MapBox component in mobile to crash because user clicks on Save button which only saves waypoint not lat & lng

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

validate={validate}

Setting false here will disable the save button in offline.

What alternative solutions did you explore? (Optional)

NA

@b4s36t4
Copy link
Contributor

b4s36t4 commented Sep 3, 2023

Warning

Whole save button is causing the issue. But with a user perspective when he's online and typing he usually select only
from auto complete. At this point solving online issue not so important I feel.

@shubham1206agra
Copy link
Contributor

okay I feel like the easy fix for now is to disable the save button when offline...

I have another fix
Requires hiding the 2 text input and updating the value of lat lng when selecting
Not sure rn

@shubham1206agra
Copy link
Contributor

But I think disable should work rn

@shubham1206agra
Copy link
Contributor

But I have another case in mind
What about some custom addresses when offline and we just want to save in draft??

@b4s36t4
Copy link
Contributor

b4s36t4 commented Sep 3, 2023

@shubham1206agra we have to launch few things tmrw. Maybe you can come up with a plan which can by solved by EOD. please mind today is sunday for us, tmrw is sunday for them.

@shubham1206agra
Copy link
Contributor

I am proposing removing these lines.

if (isOffline && waypointValue) {
const waypoint = {
lat: null,
lng: null,
address: waypointValue,
};
Transaction.saveWaypoint(transactionID, waypointIndex, waypoint);
}

And add this logic in validate

if (isOffline && waypointValue !== '') {
            errors[`waypoint${waypointIndex}`] = 'bankAccount.error.addressWhenOffline';
        }

@shubham1206agra
Copy link
Contributor

shubham1206agra commented Sep 3, 2023

Screenshot 2023-09-03 at 12 28 04 PM

It will look something like this. Text will be decided by @hayata-suenaga

@shubham1206agra
Copy link
Contributor

Screenshot 2023-09-03 at 12 51 51 PM

Do you like this method more?

@shubham1206agra
Copy link
Contributor

shubham1206agra commented Sep 3, 2023

I will also add logic to disable Next button

@pradeepmdk
Copy link
Contributor

@mountiny i think we can go with normal process @hayata-suenaga also removed this deploy blocker due to this I'm removing the deploy blocker label per this instruction

@fedirjh
Copy link
Contributor

fedirjh commented Sep 4, 2023

I agree, let's proceed with the normal deploy process.

@lanitochka17 lanitochka17 changed the title [$500] Distance - App crashes while using distance feature [$500] [Distance] - App crashes while using distance feature Sep 5, 2023
@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Sep 5, 2023
@melvin-bot melvin-bot bot changed the title [$500] [Distance] - App crashes while using distance feature [HOLD for payment 2023-09-12] [$500] [Distance] - App crashes while using distance feature Sep 5, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Sep 5, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 5, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 5, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.63-2 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2023-09-12. 🎊

After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

  • External issue reporter
  • Contributor that fixed the issue
  • Contributor+ that helped on the issue and/or PR

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

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

  • Merged PR within 3 business days of assignment - 50% bonus
  • Merged PR more than 9 business days after assignment - 50% penalty

@melvin-bot melvin-bot bot added Daily KSv2 Overdue and removed Weekly KSv2 labels Sep 12, 2023
@JmillsExpensify
Copy link

I don't see the normal BZ checklist on this issue. @fedirjh Do you think we require any regression tests in light of the crash?

@melvin-bot melvin-bot bot removed the Overdue label Sep 13, 2023
@JmillsExpensify
Copy link

Payment summary:

  • Issue reporter: N/A
  • Contributor: @pradeepmdk $750 (incl. urgency bonus)
  • Contributor+: @fedirjh $750 (incl. urgency bonus)

Offers are out. Let me know when you've accepted and we'll get this kicked off.

@fedirjh
Copy link
Contributor

fedirjh commented Sep 13, 2023

Do you think we require any regression tests in light of the crash?

@JmillsExpensify I believe we should require a regression test for this issue #26589, as it addresses the offline flow and should cover this crash.

Let me know when you've accepted and we'll get this kicked off.

Accepted.

@melvin-bot melvin-bot bot added the Overdue label Sep 15, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 18, 2023

@JmillsExpensify, @pradeepmdk, @fedirjh, @hayata-suenaga Huh... This is 4 days overdue. Who can take care of this?

@melvin-bot
Copy link

melvin-bot bot commented Sep 20, 2023

@JmillsExpensify, @pradeepmdk, @fedirjh, @hayata-suenaga 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

@hayata-suenaga
Copy link
Contributor

do we have a regression test?

@melvin-bot melvin-bot bot removed the Overdue label Sep 21, 2023
@pradeepmdk
Copy link
Contributor

@fedirjh here #26589 (comment) we are fixing here only the map is not loading when offline -> online on the web.

if we need a regression test here can we take care here itself?

@fedirjh
Copy link
Contributor

fedirjh commented Sep 22, 2023

Regression Test Proposal

  1. Open app
  2. Go offline
  3. Tap fab -> Request money -> Distance
  4. Enter Start address and save
  5. Enter Finish address and save
  6. Turn on mobile data
  7. Verify the app doesn’t crash
  • Do we agree 👍 or 👎

@melvin-bot melvin-bot bot added the Overdue label Sep 25, 2023
@hayata-suenaga
Copy link
Contributor

The regression test proposal is above

@melvin-bot melvin-bot bot removed the Overdue label Sep 25, 2023
@JmillsExpensify
Copy link

Great thanks. I'll issue payouts now and get a regression test created.

@JmillsExpensify
Copy link

All contributors paid out via Upwork. Regession test has also been created. Closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests