Skip to content

[HOLD for Payment 2024-09-06] [$250] mWeb - Submit expense - Site crashes sending a distance expense after two scan expenses #46296

Closed

Description

@lanitochka17

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.13-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/4765667
Email or phone of affected tester (no customers): nahummelaku9+d27@gmail.com
Issue reported by: Applause - Internal Team

Action Performed:

  1. Login to staging.new.expensify.com
  2. Navigate to FAB > Submit expense > Scan
  3. Upload a receipt and click on next
  4. Choose a workspace and submit it
  5. Navigate to FAB>QAB(Scan IOU)
  6. Upload a receipt and submit it to the same workspace
  7. Navigate to FAB>Submit expense > Distance
  8. Enter start and finish locations and click next
  9. Select the same workspace you submitted the scan expenses to and click submit

Expected Result:

Distance expense is created and navigated to the conversation

Actual Result:

The site crashes with a message "Uh-oh, something went wrong!"

Workaround:

Unknown

Platforms:

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

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Bug6552463_1721899827253.video_2024-07-25_12-17-52.mp4

logs (2).txt

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01890de5ca6ea4b22c
  • Upwork Job ID: 1818469788247083194
  • Last Price Increase: 2024-08-07
  • Automatic offers:
    • ikevin127 | Reviewer | 103438207
    • ShridharGoel | Contributor | 103438209
Issue OwnerCurrent Issue Owner: @ikevin127

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jul 26, 2024
  2. melvin-bot commented on Jul 26, 2024

    @melvin-bot

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

  3. ShridharGoel commented on Jul 26, 2024

    @ShridharGoel
    Contributor

    Proposal

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

    Site crashes when distance map calls fitBounds with high padding on low screen size.

    What is the root cause of that problem?

    This happens when fitBounds is called with high padding, but the screen size is small.

    map.fitBounds([northEast, southWest], {padding: mapPadding});

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

    We can make the mapPadding dependent on the screen size.

    In usages of DistanceMapView, update mapPadding to below:

    mapPadding={getIsNarrowLayout ? 0 : CONST.MAP_PADDING}
    

    This is used in ConfirmedRoute and DistanceRequestFooter.

    Else, we can put the getIsNarrowLayout check while calling fitBounds.

  4. bernhardoj commented on Jul 27, 2024

    @bernhardoj
    Contributor

    Proposal

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

    The app crash when adding a distance request after 2 scan request.

    What is the root cause of that problem?

    When we have 2 scan expense + 1 distance, the size of the preview becomes small.
    image

    Then, we set a padding of 50 to the map which will be used when trying to center the map.

    mapPadding={CONST.MAP_PADDING}

    map.fitBounds([northEast, southWest], {padding: mapPadding});

    However, the size of the map is smaller than the padding combined (left+right / top+bottom).

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

    Change the padding to the smallest size (or 0 or decrease the value) if it's bigger than the map size.

    let newMapPadding = mapPadding;
    if (mapPadding && mapPadding > 0 && (mapPadding * 2 > mapRef.getCanvas().clientHeight || mapPadding * 2 > mapRef.getCanvas().clientWidth)) {
        newMapPadding = Math.min(mapRef.getCanvas().clientHeight, mapRef.getCanvas().clientWidth) / 2; // or 0
    }
    map.fitBounds([northEast, southWest], {padding: newMapPadding});
    
  5. melvin-bot commented on Jul 29, 2024

    @melvin-bot

    @greg-schroeder Whoops! This issue is 2 days overdue. Let's get this updated quick!

  6. self-assigned this
    on Jul 31, 2024
  7. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Jul 31, 2024
  8. changed the title [-]mWeb - Submit expense - Site crashes sending a distance expense after two scan expenses[/-] [+][$250] mWeb - Submit expense - Site crashes sending a distance expense after two scan expenses[/+] on Jul 31, 2024
  9. melvin-bot commented on Jul 31, 2024

    @melvin-bot
  10. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jul 31, 2024
  11. 42 remaining items

  12. ShridharGoel commented on Aug 21, 2024

    @ShridharGoel
    Contributor

    @ikevin127 Maybe you can start the testing from your side till the adhoc builds are available. I need the adhoc builds since I'm unable to build locally.

  13. greg-schroeder commented on Aug 27, 2024

    @greg-schroeder
    Contributor

    This on staging. Awaiting deploy to prod

  14. ikevin127 commented on Sep 3, 2024

    @ikevin127
    Contributor

    ⚠️ We just got confirmation on Slack that the Deploy Checklist: New Expensify 2024-08-26 which includes the PR of this issue was only deployed to production today in Deploy Checklist: New Expensify 2024-08-28. More context on why this happened can be found in this Slack thread and this Slack comment.

    Given the context above, this issue should be on Payment 2024-09-06 according to 4 days ago's production deploy from Deploy Checklist: New Expensify 2024-08-28.

    cc @greg-schroeder @marcaaron

  15. changed the title [-][$250] mWeb - Submit expense - Site crashes sending a distance expense after two scan expenses[/-] [+][HOLD for Payment 2024-09-06] [$250] mWeb - Submit expense - Site crashes sending a distance expense after two scan expenses[/+] on Sep 4, 2024
  16. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed
    ReviewingHas a PR in review
    on Sep 4, 2024
  17. greg-schroeder commented on Sep 4, 2024

    @greg-schroeder
    Contributor

    Updated

  18. ikevin127 commented on Sep 5, 2024

    @ikevin127
    Contributor

    Regression Test Proposal

    1. Login to staging.new.expensify.com .
    2. Navigate to FAB > Submit expense > Scan.
    3. Upload a receipt and click on Next.
    4. Choose a workspace and submit it.
    5. Navigate to FAB > QAB (Scan IOU).
    6. Upload a receipt and submit it to the same workspace.
    7. Navigate to FAB > Submit expense > Distance.
    8. Enter start and finish locations and click Next.
    9. Select the same workspace you submitted the scan expenses to and click Submit.
    10. Test on different screen sizes / heights (iPhone 4 / 5, Samsung Galaxy S8, etc) and verify that the app doesn't crash when submitting the 3rd Distance request.

    Do we agree 👍 or 👎.

  19. ikevin127 commented on Sep 8, 2024

    @ikevin127
    Contributor
  20. greg-schroeder commented on Sep 9, 2024

    @greg-schroeder
    Contributor

    Sorry, processing

  21. greg-schroeder commented on Sep 9, 2024

    @greg-schroeder
    Contributor

    Paid @ikevin127 , sent new offer to @ShridharGoel. Will pay ASAP once accepted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.ExternalAdded to denote the issue can be worked on by a contributorWeeklyKSv2

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions