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

[$250] Desktop - Distance - Opens "Hmm it's not here" when you open the "Start" menu a second time #47422

Closed
1 of 6 tasks
IuliiaHerets opened this issue Aug 14, 2024 · 35 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Aug 14, 2024

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: v9.0.20-0
Reproducible in staging?: Y
Reproducible in production?: N
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/4857130
Email or phone of affected tester (no customers): sustinov@applausemail.com
Issue reported by: Applause Internal Team

Action Performed:

  1. Open New Expensify app
  2. Log in with a new HT account
  3. Create a WS
  4. Navigate to the WS room
  5. Navigate + Menu - Submit expense - Distance - Start
  6. Close the RHP by clicking outside the field
  7. Navigate + Menu - Submit expense - Distance - Start

Expected Result:

When you open the "Start" menu a second time, a waypoint entry field should appear

Actual Result:

Opens "Hmm it's not here" when you open the "Start" menu a second time

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug6571800_1723622887402.Recording__84.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~015866c373fa1fa23d
  • Upwork Job ID: 1823829918353045323
  • Last Price Increase: 2024-08-21
  • Automatic offers:
    • rayane-djouah | Contributor | 103694978
Issue OwnerCurrent Issue Owner: @jayeshmangwani
@IuliiaHerets IuliiaHerets added DeployBlockerCash This issue or pull request should block deployment Bug Something is broken. Auto assigns a BugZero manager. labels Aug 14, 2024
Copy link

melvin-bot bot commented Aug 14, 2024

Triggered auto assignment to @puneetlath (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

Copy link

melvin-bot bot commented Aug 14, 2024

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

@melvin-bot melvin-bot bot added the Daily KSv2 label Aug 14, 2024
@github-actions github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels Aug 14, 2024
Copy link
Contributor

👋 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.

@IuliiaHerets
Copy link
Author

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

@Beamanator
Copy link
Contributor

Hmm couldn't reproduce in v9.0.20-5 in Web, will try desktop next

@Beamanator
Copy link
Contributor

oh ya def reproducible

console error:

Url.ts:48 Error parsing URLs: TypeError: Failed to construct 'URL': Invalid URL

@Beamanator
Copy link
Contributor

Though I donn't know if I'd reeeeeeally consider this a blocker blocker 🤷 maybe we can keep it open till someone can maybe help, but if it becomes the last blocker open we can NAB it

@Beamanator Beamanator added the External Added to denote the issue can be worked on by a contributor label Aug 14, 2024
Copy link

melvin-bot bot commented Aug 14, 2024

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

@melvin-bot melvin-bot bot changed the title Desktop - Distance - Opens "Hmm it's not here" when you open the "Start" menu a second time [$250] Desktop - Distance - Opens "Hmm it's not here" when you open the "Start" menu a second time Aug 14, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Aug 14, 2024
Copy link

melvin-bot bot commented Aug 14, 2024

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

@NJ-2020
Copy link
Contributor

NJ-2020 commented Aug 15, 2024

Proposal

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

What is the root cause of that problem?

When we click the submit expense we initialize the money request by invoking the IOU.initMoneyRequest function.

Inside the initMoneyRequest function we check if the currentTransaction.iouRequestType is equal to selected current iouRequestType then we only need to update only few values of the draftTransaction and exit from the function

App/src/libs/actions/IOU.ts

Lines 327 to 337 in 57ef25c

if (currentTransaction?.iouRequestType === iouRequestType) {
// so, we just need to update the reportID, isFromGlobalCreate, created, currency
Onyx.merge(`${ONYXKEYS.COLLECTION.TRANSACTION_DRAFT}${newTransactionID}`, {
reportID,
isFromGlobalCreate,
created,
currency,
transactionID: newTransactionID,
});
return;
}

And also every we click the submit expense we also invoke the startMoneyRequest and clearMoneyRequest function, and after clicking the start waypoint page and go back and click again the submit expense button and go to start waypoint page again, the currentTransaction(draftTransaction) doesn't get clear because the clearMoneyRequest take a little bit longer than the web browser, but it got cleared after the initMoneyRequest if condition run

If we do on web browser we can see more faster action for the Onyx that the draft transaction is got cleared before the if statement run, and the comment.waypoint doesn't set with the correctly because inside the if statement we return (exit from the function)

But in web browser the if statement doesn't run because the draftTransaction got cleared first before the if condition run

App/src/libs/actions/IOU.ts

Lines 381 to 387 in 57ef25c

function clearMoneyRequest(transactionID: string, skipConfirmation = false) {
Onyx.set(`${ONYXKEYS.COLLECTION.SKIP_CONFIRMATION}${transactionID}`, skipConfirmation);
Onyx.set(`${ONYXKEYS.COLLECTION.TRANSACTION_DRAFT}${transactionID}`, null);
}
function startMoneyRequest(iouType: ValueOf<typeof CONST.IOU.TYPE>, reportID: string, requestType?: IOURequestType, skipConfirmation = false) {
clearMoneyRequest(CONST.IOU.OPTIMISTIC_TRANSACTION_ID, skipConfirmation);

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

On clearMoneyRequest function we can return the Onyx.set for the transaction draft

App/src/libs/actions/IOU.ts

Lines 381 to 384 in 57ef25c

function clearMoneyRequest(transactionID: string, skipConfirmation = false) {
Onyx.set(`${ONYXKEYS.COLLECTION.SKIP_CONFIRMATION}${transactionID}`, skipConfirmation);
Onyx.set(`${ONYXKEYS.COLLECTION.TRANSACTION_DRAFT}${transactionID}`, null);
}

And we can use the .then method inside the startMoneyRequest function to wait until we clear the draftTransaction

https://github.com/Expensify/App/blob/57ef25c998748332864ae98a43579989d6529c22/src/libs/actions/IOU.ts#L386C10-L388

Result:

Screen.Recording.2024-08-14.at.23.46.35.mov

What alternative solutions did you explore? (Optional)

We can use promise resolve, and resolve when the Onyx completed
Or we can use an Onyx key to detect if the clearTransaction is completed

@jayeshmangwani
Copy link
Contributor

@NJ-2020 Thanks for the proposal, but I'm unclear on a few points. Let me break it down below:

But in web browser the if statement doesn't run because the draftTransaction got cleared first before the if condition run

Why is this happening only on desktop, and only on this page? If the desktop doesn't update data synchronously, it should be happening in other places too.

we can use the .then method inside the startMoneyRequest function to wait until we clear the draftTransaction

I haven't noticed this pattern in any Onyx updates on the app. Could you please provide some examples if we're supposed to follow this pattern?

@jayeshmangwani
Copy link
Contributor

I was checking logs and noticed that the transaction data is incorrect on the desktop platform.

It should be like this:
{
  "amount": 0,
  "comment": {
      "waypoints": {
          "waypoint0": {
              "keyForList": "start_waypoint"
          },
          "waypoint1": {
              "keyForList": "stop_waypoint"
          }
      },
      "customUnit": {
          "customUnitRateID": "3C14F0F0D0778"
      }
  },
  "created": "2024-08-15",
  "currency": "INR",
  "iouRequestType": "distance",
  "reportID": "4585884576347998",
  "transactionID": "1",
  "isFromGlobalCreate": false,
  "merchant": "(none)",
  "splitPayerAccountIDs": [
      18152125
  ]
}
But instead, it's like this (no comment waypoints data is included):
{
  "amount": 0,
  "comment": {},
  "created": "2024-08-15",
  "currency": "INR",
  "iouRequestType": "manual",
  "reportID": "4585884576347998",
  "transactionID": "1",
  "isFromGlobalCreate": false,
  "merchant": "(none)",
  "splitPayerAccountIDs": [
      18152125
  ]
}

@jayeshmangwani
Copy link
Contributor

@puneetlath @Beamanator Though it's an hourly issue, I still believe we should avoid adding the promise for the Onyx set until we identify the root cause, as this issue is specific to the desktop platform.

@NJ-2020
Copy link
Contributor

NJ-2020 commented Aug 15, 2024

Why is this happening only on desktop, and only on this page? If the desktop doesn't update data synchronously, it should be happening in other places too.

@jayeshmangwani I don't know, but I think because Electron maybe, I've tried to console log inside browser and desktop and I see that the log for clearing the transaction in browser came first before the if condition run, and the draftTransaction got empty before the if condition run

But on desktop side the clear function took a little bit more longer and I tried to console log, and the if condition runs before the draftTransaction got cleared, and after the if statement run, the draft transaction got cleared

I was checking logs and noticed that the transaction data is incorrect on the desktop platform.

Yes i know this, I see on browser why it works as expected and try to console the draftTransaction and showing undefined value for the 2 second time opening the start way point which make the if condition do not run

Thanks.

@NJ-2020
Copy link
Contributor

NJ-2020 commented Aug 15, 2024

We can also add return statement to Onyx.set method and use .then method when the Onyx is complete

@puneetlath
Copy link
Contributor

Do we know why this is happening on staging but not production?

@puneetlath
Copy link
Contributor

@jayeshmangwani I agree with you that let's make sure we understand the root cause before we go forward with a solution.

@jayeshmangwani
Copy link
Contributor

Do we know why this is happening on staging but not production?

I'm trying to figure this out. I can confirm that the issue is coming from this PR #45982. I reverted the changes locally, and the issue disappeared. I'm still working on pinpointing the exact line of code that's causing this

@puneetlath Other Issue still in the regression period should we assign the author and C+ of that PR to tackle this issue?

@puneetlath
Copy link
Contributor

That sounds good to me yes. @dominictb can you please look into this?

cc @rayane-djouah @tgolen

Copy link

melvin-bot bot commented Aug 19, 2024

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

@melvin-bot melvin-bot bot added the Overdue label Aug 19, 2024
@rayane-djouah
Copy link
Contributor

Friendly reminder @dominictb

@dominictb
Copy link
Contributor

@rayane-djouah noted. I'll take a look as soon as possible.

@jayeshmangwani
Copy link
Contributor

Not Overdue;
PR will be raised by @dominictb and reviewed by @rayane-djouah, as this issue stems from their previous PR."

@melvin-bot melvin-bot bot removed the Overdue label Aug 21, 2024
Copy link

melvin-bot bot commented Aug 21, 2024

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@dominictb
Copy link
Contributor

Latest update: I'm trying to reproduce the issue.

@jayeshmangwani
Copy link
Contributor

I am unassigning myself from the Issue. @puneetlath / @RachCHopkins Please assign the issue to @rayane-djouah and @dominictb

@jayeshmangwani jayeshmangwani removed their assignment Aug 22, 2024
@dominictb
Copy link
Contributor

@rayane-djouah I have some trouble reproducing this issue locally. Could you?

@NJ-2020
Copy link
Contributor

NJ-2020 commented Aug 22, 2024

Same here, I cannot reproduce the issue

@jayeshmangwani
Copy link
Contributor

Issue seems to be resolved now. I am also no longer able to reproduce it.

@melvin-bot melvin-bot bot added the Overdue label Aug 26, 2024
@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Aug 27, 2024
Copy link

melvin-bot bot commented Aug 27, 2024

📣 @rayane-djouah 🎉 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 melvin-bot bot removed the Overdue label Aug 27, 2024
@RachCHopkins
Copy link
Contributor

@rayane-djouah can you please see if you can still reproduce this?

Copy link

melvin-bot bot commented Aug 28, 2024

@puneetlath @RachCHopkins @rayane-djouah @dominictb 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!

@rayane-djouah
Copy link
Contributor

Not able to reproduce

Screen.Recording.2024-08-28.at.7.09.28.PM.mov

@puneetlath
Copy link
Contributor

@RachCHopkins should we just close it then?

@melvin-bot melvin-bot bot added the Overdue label Sep 2, 2024
Copy link

melvin-bot bot commented Sep 3, 2024

@puneetlath, @RachCHopkins, @rayane-djouah, @dominictb Eep! 4 days overdue now. Issues have feelings too...

@melvin-bot melvin-bot bot removed the Overdue label Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is broken. Auto assigns a BugZero manager. 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

8 participants