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-29] [$500] BUG: [distance] request map is cut off after going online #26540

Closed
6 tasks
neil-marcellini opened this issue Sep 1, 2023 · 46 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@neil-marcellini
Copy link
Contributor

neil-marcellini commented Sep 1, 2023

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


Action Performed:

  1. Run App on latest main branch (for now)
  2. Sign in with an account on the distance requests beta (or enable all betas)
  3. Go offline
  4. Click green plus, request money, distance, enter start and finish addresses
  5. Click next
  6. Go online and maybe wait a bit
  7. Go back to the page with the map

Expected Result:

The route renders properly on the map and it's not cut off

Actual Result:

The bottom section of the map is cut off and the bottom corners are not rounded

Workaround:

Ignore it

Platforms:

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

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

Version Number: unreleased
Reproducible in staging?: Not yet
Reproducible in production?: Not yet
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: Originally reported by
@situchan
in a PR review here
Expensify/Expensify Issue URL:
Issue reported by: @situchan
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1693609781739659

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~016004dbcd8eeeb10d
  • Upwork Job ID: 1697749501998895104
  • Last Price Increase: 2023-09-08
  • Automatic offers:
    • nahid633 | Contributor | 26681342
    • situchan | Reporter | 26681346
@neil-marcellini neil-marcellini added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Sep 1, 2023
@neil-marcellini neil-marcellini self-assigned this Sep 1, 2023
@melvin-bot melvin-bot bot changed the title BUG: [distance] request map is cut off after going online [$500] BUG: [distance] request map is cut off after going online Sep 1, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 1, 2023

Triggered auto assignment to @trjExpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@melvin-bot
Copy link

melvin-bot bot commented Sep 1, 2023

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

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

melvin-bot bot commented Sep 1, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@melvin-bot
Copy link

melvin-bot bot commented Sep 1, 2023

Triggered auto assignment to @sophiepintoraetz (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.

@melvin-bot
Copy link

melvin-bot bot commented Sep 1, 2023

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

@neil-marcellini
Copy link
Contributor Author

Side note:bug: if I create a new issue with external and bug labels it assigns two BZ.

@b4s36t4
Copy link
Contributor

b4s36t4 commented Sep 1, 2023

@neil-marcellini when we go back to online, the amount should be update there itself? means ConfirmPage itself or the user needs to go back the page?

@b4s36t4

This comment was marked as off-topic.

@paultsimura
Copy link
Contributor

@neil-marcellini please note that my proposal in #26537 fixes the route rendering issue.
These 2 bugs look quite related.
Also it seems like @b4s36t4 's proposal belongs more to that issue than to this one.

@studentofcoding
Copy link
Contributor

#Proposal

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

BUG: [distance] request map is cut off after going online

What is the root cause of that problem?

The bug appears because the application does not re-fetch the MapBox route when transitioning from offline to online. This means that if the user goes offline and then comes back online, the MapBox route is not updated, causing it not to appear correctly.

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

Add a mechanism to

function DistanceRequest({iou, iouType, report, transaction, mapboxAccessToken}) {
using useEffect to listens for changes in the network status and triggers a re-fetch of the MapBox route when the application goes from offline to online.

function DistanceRequest({iou, iouType, report, transaction, mapboxAccessToken}) {
    const previousIsOffline = usePrevious(isOffline); // Add this line to store the previous network status

    // ... (rest of the code)


    // Add this useEffect hook
    useEffect(() => {
        if (!previousIsOffline || isOffline || !iou.transactionID) {
            return;
        }
    
        Transaction.getRoute(iou.transactionID, waypoints);
    }, [isOffline, previousIsOffline, iou.transactionID, waypoints]);

    // ... (rest of the code)
}

What alternative solutions did you explore? (Optional)

None

Result

cropped_mapbox_fixed.mp4

@studentofcoding
Copy link
Contributor

#Proposal

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

BUG: [distance] request map is cut off after going online

What is the root cause of that problem?

The bug appears because the application does not re-fetch the MapBox route when transitioning from offline to online. This means that if the user goes offline and then comes back online, the MapBox route is not updated, causing it not to appear correctly.

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

Add a mechanism to

function DistanceRequest({iou, iouType, report, transaction, mapboxAccessToken}) {

using useEffect to listens for changes in the network status and triggers a re-fetch of the MapBox route when the application goes from offline to online.

function DistanceRequest({iou, iouType, report, transaction, mapboxAccessToken}) {
    const previousIsOffline = usePrevious(isOffline); // Add this line to store the previous network status

    // ... (rest of the code)


    // Add this useEffect hook
    useEffect(() => {
        if (!previousIsOffline || isOffline || !iou.transactionID) {
            return;
        }
    
        Transaction.getRoute(iou.transactionID, waypoints);
    }, [isOffline, previousIsOffline, iou.transactionID, waypoints]);

    // ... (rest of the code)
}

What alternative solutions did you explore? (Optional)

None

Result

cropped_mapbox_fixed.mp4

cc : @neil-marcellini

@b4s36t4
Copy link
Contributor

b4s36t4 commented Sep 3, 2023

@studentofcoding I don't think you understand the bug correctly. This isn't about loading the route or not.

Sometimes when you only have two waypoints and move offline and online back and forth and doing some things like closing modal selecting an address or adding and removing multiple waypoints causing the map to cutoff.

Like in your video you have the map fully, but the bug is you'll be having the map but the bottom of the map like 10-15% of it is showing as black which is weird and that is the bug.

Let me know if you don't understand the bug.

@melvin-bot melvin-bot bot added the Overdue label Sep 4, 2023
@ArekChr
Copy link
Contributor

ArekChr commented Sep 4, 2023

@neil-marcellini, could you please provide a video showing the actual results of this issue and specify which platforms are affected?

@melvin-bot melvin-bot bot removed the Overdue label Sep 4, 2023
@trjExpensify
Copy link
Contributor

@ArekChr a video came with the report here by @situchan in the PR: #25707 (review)

@nahid633
Copy link
Contributor

nahid633 commented Sep 4, 2023

Proposal

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

BUG: [distance] request map is cut off after going online

What is the root cause of that problem?

The problem is related to Mapbox resizing.It is related to the size of the container where the is located.

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

we should call mapRef.resize(). For that we need ResizeObserver to detect size changes on the canvas container.

What alternative solutions did you explore? (Optional)

none

Untitled.mp4

@melvin-bot
Copy link

melvin-bot bot commented Sep 4, 2023

📣 @nahid633! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:

  1. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  2. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  3. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
    Screen Shot 2022-11-16 at 4 42 54 PM
    Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

@nahid633
Copy link
Contributor

nahid633 commented Sep 4, 2023

Contributor details
Your Expensify account email: [email protected]
Upwork Profile Link: https://www.upwork.com/freelancers/~018b5a73519689f99a

@melvin-bot
Copy link

melvin-bot bot commented Sep 4, 2023

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

@melvin-bot
Copy link

melvin-bot bot commented Sep 14, 2023

📣 @nahid633 🎉 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 📖

@melvin-bot
Copy link

melvin-bot bot commented Sep 14, 2023

📣 @situchan 🎉 An offer has been automatically sent to your Upwork account for the Reporter role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job

@melvin-bot
Copy link

melvin-bot bot commented Sep 15, 2023

@trjExpensify @nahid633 @ArekChr @neil-marcellini 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!

@ArekChr
Copy link
Contributor

ArekChr commented Sep 15, 2023

@nahid633 Friendly bump, any progress with the PR?

@nahid633
Copy link
Contributor

Hey @ArekChr , i got offer from upwork today. I will finish and create PR today.

@nahid633 nahid633 mentioned this issue Sep 16, 2023
59 tasks
@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Sep 16, 2023
@nahid633
Copy link
Contributor

@ArekChr PR is ready

@melvin-bot
Copy link

melvin-bot bot commented Sep 20, 2023

Based on my calculations, the pull request did not get merged within 3 working days of assignment. Please, check out my computations here:

  • when @nahid633 got assigned: 2023-09-14 20:20:15 Z
  • when the PR got merged: 2023-09-20 07:15:12 UTC
  • days elapsed: 3

On to the next one 🚀

@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 22, 2023
@melvin-bot melvin-bot bot changed the title [$500] BUG: [distance] request map is cut off after going online [HOLD for payment 2023-09-29] [$500] BUG: [distance] request map is cut off after going online Sep 22, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Sep 22, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 22, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 22, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.72-11 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-29. 🎊

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
Copy link

melvin-bot bot commented Sep 22, 2023

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:

  • [@ArekChr] The PR that introduced the bug has been identified. Link to the PR:
  • [@ArekChr] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
  • [@ArekChr] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
  • [@ArekChr] Determine if we should create a regression test for this bug.
  • [@ArekChr] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@trjExpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@trjExpensify
Copy link
Contributor

👋 @ArekChr can you get tot he checklist please so we can proceed with the payments? Thanks!

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

melvin-bot bot commented Oct 2, 2023

@trjExpensify, @nahid633, @ArekChr, @neil-marcellini Whoops! This issue is 2 days overdue. Let's get this updated quick!

@trjExpensify
Copy link
Contributor

Awaiting the above!

@melvin-bot melvin-bot bot removed the Overdue label Oct 2, 2023
@ArekChr
Copy link
Contributor

ArekChr commented Oct 3, 2023

  • Link to the PR: No bug identified.
  • Link to comment: n/a
  • Link to discussion: n/a
  • Determine if we should create a regression test for this bug: I don’t think we need to add a regression test here.

@trjExpensify
Copy link
Contributor

Thanks! I tend to agree a visual display issue like a cut off map will be captured in the regression testing of the distance feature, so we don't need a standalone one.

Confirming payments as follows:

Settled up, 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 Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

8 participants