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.31k stars 2.74k forks source link

[$250] IOU-Duplicate waypoints occur if delete the waypoint via Troubleshoot-Force Offline #41086

Closed izarutskaya closed 1 month ago

izarutskaya commented 4 months 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: v1.4.66-2 Reproducible in staging?: Y Reproducible in production?: Y Logs: https://stackoverflow.com/c/expensify/questions/4856 Issue reported by: Applause-Internal team

Action Performed:

  1. Create a distance request with 3 or more waypoints
  2. Navigate to the distance expense details conversation
  3. Disable the internet connection via Troubleshoot-Force Offline
  4. Select the the distance item
  5. Verify you’re navigated to a page to edit the waypoints of the route
  6. Verify the waypoints you initially input are already set
  7. Remove any stop from the route via selecting it and deleting
  8. Save the change
  9. Go back online
  10. Select the the distance item and verify duplicate waypoints
  11. Click on the mini map to see the distance receipt and verify duplicate waypoints

Expected Result:

Deleted waypoint should vanish

Actual Result:

Two same waypoints appear after getting online if user deletes any of the waypoints via Troubleshoot-Force Offline Note: The issue does not occur if internet connection is turned off via computer/router.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

https://github.com/Expensify/App/assets/115492554/0ce65153-f434-4580-9267-71dbd091c571

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0137e06a0e9b33107e
  • Upwork Job ID: 1784774224953176064
  • Last Price Increase: 2024-08-08
melvin-bot[bot] commented 4 months ago

Triggered auto assignment to @adelekennedy (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 4 months ago

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

adelekennedy commented 4 months ago

reproducible - moving it to wave collect for distance

melvin-bot[bot] commented 4 months ago

Job added to Upwork: https://www.upwork.com/jobs/~0137e06a0e9b33107e

melvin-bot[bot] commented 4 months ago

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

melvin-bot[bot] commented 4 months ago

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

adelekennedy commented 4 months ago

no takers but this is a polish issue

melvin-bot[bot] commented 4 months ago

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

adelekennedy commented 4 months ago

still waiting

melvin-bot[bot] commented 4 months ago

@parasharrajat @adelekennedy 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!

adelekennedy commented 4 months ago

I'm not going to increase the price on this one as it's pretty edge case-y

MrMuzyk commented 3 months ago

I am Michał from Callstack - expert contributor group. I’d like to work on this job.

parasharrajat commented 3 months ago

@MrMuzyk Let's go.

MrMuzyk commented 3 months ago

I believe the issue is somewhere inside react-native-onyx and I will explain why is that below. First I wanted to add that @rezkiy37 is debugging issue that is similar to this one and root cause might be the same - onyx returning incorrect data. It might be a tricky one to fix, I dont have a solution yet and it would have to be in react-native-onyx. I will investigate this more and see if I can come up with some kind of fix for this.

Here are my findings:

I've added a couple of logs inside component displaying waypoints

Screenshot 2024-05-14 at 11 09 58

Next I've reproduced the issue step by step. On the first screenshot IOU is stored correctly inside OnyxDB.

1

I've went offline and opened the receipt. We can see in the console that it logged 2 waypoints correctly as it should which are later on passed to proper component that display them

2

I've checked OnyxDB and receipt was stored correctly there

3

After that I've removed one waypoint, saved it and went back online. We can see in the console that component received via props a transaction that had 3 waypoints in it - one was duplicated. This console.log happens straight away after receiving waypoints from props. They're not modified in any way before they're passed to component - this is data straight out of Onyx.

4

However when we look inside OnyxDB we can see that data stored there is correct - it has only 2 waypoints. I believe that the issue has to be somewhere inside onyx because this is the only place where this data could be modified during process of extracting it from OnyxDB and passing it component.

5

I'd like to also point out that the issue doesn't exist after page refresh - it's just a one time thing after turning off offline mode in the app. I also wasn't able to reproduce that issue when disabling internet connection via devtools or disabling/enabling directly wifi on my machine

adelekennedy commented 3 months ago

@MrMuzyk

I'd like to also point out that the issue doesn't exist after page refresh - it's just a one time thing after turning off offline mode in the app. I also wasn't able to reproduce that issue when disabling internet connection via devtools or disabling/enabling directly wifi on my machine

In this case this doesn't seem worth it to me to keep this issue open, unless I'm missing something a "real" user wouldn't actually experience this?

melvin-bot[bot] commented 3 months ago

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

MrMuzyk commented 3 months ago

It shouldn't. Here is recording where I'm not able to reproduce the same behaviour while turning of wifi on my laptop

https://github.com/Expensify/App/assets/23487612/c4a1b786-2d0a-4398-9db0-61a58191bef1

parasharrajat commented 3 months ago

I agree with @adelekennedy here.

izarutskaya commented 2 months ago

Issue is still reproducible on iOS and Android App build 9.0.6-0

https://github.com/Expensify/App/assets/115492554/d684055f-c519-4b66-83cc-14b3196904d0

parasharrajat commented 2 months ago

@izarutskaya Can you try to reproduce this issue by disabling the internet on device instead of in-app?

melvin-bot[bot] commented 2 months ago

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

parasharrajat commented 1 month ago

Any updates @izarutskaya?

melvin-bot[bot] commented 1 month ago

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

melvin-bot[bot] commented 1 month ago

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

izarutskaya commented 1 month ago

Let me try please

izarutskaya commented 1 month ago

@parasharrajat It is reproducible by disabling the internet on device

https://github.com/user-attachments/assets/d3bf69ac-313a-436b-8a0d-8870b455d54b

parasharrajat commented 1 month ago

@MrMuzyk Looks like the issue is still present on native devices. Would you mind giving it another look?

MrMuzyk commented 1 month ago

@parasharrajat I can look into it again but as my original comment with explanation stated - I believe that issue has to be on the Onyx side. Data that we're getting is coming straight from the Onyx and yet it's incorrect.

parasharrajat commented 1 month ago

Yes, Please let see how can we solve this.

MrMuzyk commented 1 month ago

I've tried again to reproduce that on web and couldn't get the same result - it's working fine on web. Sadly I do not have real mobile device to try to reproduce that.

https://github.com/user-attachments/assets/d5635752-4c05-45a5-bc09-97d6ec579c0a

parasharrajat commented 1 month ago

I will try this today.

melvin-bot[bot] commented 1 month ago

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

mvtglobally commented 1 month ago

Issue not reproducible during KI retests. (First week)

parasharrajat commented 1 month ago

I can not reproduce this issue.

melvin-bot[bot] commented 1 month ago

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

adelekennedy commented 1 month ago

It seems like we can close this out (I also can't reproduce either)