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 2024-03-06] [$500] Distance - Distance request preview in the main chat is grayed out offline when created online #34910

Closed
6 tasks done
lanitochka17 opened this issue Jan 22, 2024 · 53 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. Engineering External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2

Comments

@lanitochka17
Copy link

lanitochka17 commented Jan 22, 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: 1.4.29-1
Reproducible in staging?: Y
Reproducible in production?: Y
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
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:

Action Performed:

  1. Create a new workspace chat
  2. Go to workspace chat
  3. Create two distance requests
  4. Click into one of the distance requests so you can see the request details.
  5. Navigate back to the workspace chat.
  6. Go offline.
  7. Open expense report

Expected Result:

The distance requests will not appear grayed out in offline mode since they are created online

Actual Result:

The distance requests appear grayed out in offlne mode when they are created online. However, the requests are not grayed out in the expense report. This indicates that it is not network connection issue as the expense preview will appear grayed out in both the main chat and expense report if it is network issue

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

Bug6350727_1705942706606.bandicam_2024-01-22_20-27-17-314.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~010290c226a17cdffb
  • Upwork Job ID: 1749510686242873344
  • Last Price Increase: 2024-02-05
  • Automatic offers:
    • fedirjh | Reviewer | 0
    • tienifr | Contributor | 0
@lanitochka17 lanitochka17 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 Jan 22, 2024
@melvin-bot melvin-bot bot changed the title Distance - Distance request preview in the main chat is grayed out offline when created online [$500] Distance - Distance request preview in the main chat is grayed out offline when created online Jan 22, 2024
Copy link

melvin-bot bot commented Jan 22, 2024

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

Copy link

melvin-bot bot commented Jan 22, 2024

Job added to Upwork: https://www.upwork.com/jobs/~010290c226a17cdffb

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Jan 22, 2024
Copy link

melvin-bot bot commented Jan 22, 2024

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

@lanitochka17
Copy link
Author

We think that this bug might be related to #wave.
CC @DylanDylann

@paultsimura
Copy link
Contributor

paultsimura commented Jan 22, 2024

CC @DylanDylann

Wrong tag @lanitochka17 🙂

@abzokhattab
Copy link
Contributor

abzokhattab commented Jan 22, 2024

Proposal

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

Distance request preview in the main chat is grayed out offline when created online

What is the root cause of that problem?

the pendingFields of the preview are set here and it's cleared with pendingFields: null here

however apparently setting the pending fields to null doesnt properly work we need to specify the fields inside the pendingFields and set them to null as we usually do in most of the other actions

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

change this to:

                pendingFields: {
                    ...(isNewIOUReport ? {createChat: null} : {preview: null}),
                },

and also do the same here

where we need to change it to

                ...(isNewChatReport ? {pendingFields: {createChat:null }} : {}),

additionally, the same should be done in the failureData as well .. and we may do the same in other null fields as well

Result:

Untitled.mov

@tienifr
Copy link
Contributor

tienifr commented Jan 23, 2024

Proposal

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

The distance requests appear grayed out in offlne mode when they are created online. However, the requests are not grayed out in the expense report. This indicates that it is not network connection issue as the expense preview will appear grayed out in both the main chat and expense report if it is network issue

What is the root cause of that problem?

This issue happens when we call 2 APIs (CreateDistanceRequest, OpenReport) at the same time, so the responses from 2 requests will be added to the queue then after the sequential queue has flushed to prevent a replay effect.

// For most requests we can immediately update Onyx. For write requests we queue the updates and apply them after the sequential queue has flushed to prevent a replay effect in
// the UI. See https://github.com/Expensify/App/issues/12775 for more info.
const updateHandler = request?.data?.apiRequestType === CONST.API_REQUEST_TYPE.WRITE ? QueuedOnyxUpdates.queueOnyxUpdates : Onyx.update;

  1. After create the second distance request, pendingFields of optimisticData is
pendingFields:{
    preview: 'update'
}
  1. Let's take a look at the successData of CreateDistanceRequest here
                pendingFields: null,

the successData of OpenReport here

pendingFields: {
                createChat: null,
            },
  1. After the sequential queue has flushed, they would be merged to
pendingFields: {
                createChat: null,
            },

so pendingFields.preview is not cleared

-> When users go offline, it's greyed out

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

Solution 1:

We should clear all pendingFields in successData as we already did in other places

                pendingFields: null,
                errorFields: null

Solution 2:
It doesn't make sense when we always clear pendingFields in successData even though we do not set it in optimistic data. We should move successData to this block when we want to create the new report

What alternative solutions did you explore? (Optional)

NA

Result

Screen.Recording.2024-01-23.at.16.51.37.mp4

@joekaufmanexpensify
Copy link
Contributor

I can't reproduce this on my end following the above steps. Is this consistently reproducible for others?

2024-01-23_11-13-45.mp4

@abzokhattab
Copy link
Contributor

Update: POC was Added.

@joekaufmanexpensify
Copy link
Contributor

I just tried again, and still can't reproduce this. Closing as this doesn't seem to be consistently reproducible.

@tienifr
Copy link
Contributor

tienifr commented Jan 24, 2024

@joekaufmanexpensify @abzokhattab I can still reproduce. Please follow these steps:

  1. Create a new workspace chat
  2. Go to workspace chat
  3. Create two distance requests
  4. Open expense report
  5. Go offline

@tienifr
Copy link
Contributor

tienifr commented Jan 25, 2024

@joekaufmanexpensify any updates?

@tienifr
Copy link
Contributor

tienifr commented Jan 26, 2024

@joekaufmanexpensify @abzokhattab I still can reproduce

@joekaufmanexpensify
Copy link
Contributor

Thanks for flagging. I am taking another look.

@joekaufmanexpensify
Copy link
Contributor

I tried to reproduce again, and I can now. The key is after creating the two distance requests, you need to click into the request details for one of them, navigate back to the workspace chat, and then go offline to reproduce this.

If you don't click into the request details for one of the requests, there is no issue when going offline (as shown by my reproduction attempt here.)

I added this to the reproduction steps in OP, as it was not clear before.

@joekaufmanexpensify
Copy link
Contributor

@fedirjh all yours to review proposals

@melvin-bot melvin-bot bot added the Overdue label Jan 29, 2024
@joekaufmanexpensify
Copy link
Contributor

Pending review from @fedirjh

@melvin-bot melvin-bot bot removed the Overdue label Jan 29, 2024
Copy link

melvin-bot bot commented Jan 29, 2024

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

@joekaufmanexpensify
Copy link
Contributor

@fedirjh could you please take a look at the proposals here when you have a chance?

@joekaufmanexpensify
Copy link
Contributor

@iwiznia mind signing off on the proposal here when you have a sec?

@melvin-bot melvin-bot bot added the Overdue label Feb 12, 2024
Copy link

melvin-bot bot commented Feb 12, 2024

@iwiznia @fedirjh @joekaufmanexpensify this issue is now 3 weeks old. There is one more week left before this issue breaks WAQ and will need to go internal. What needs to happen to get a PR in review this week? Please create a thread in #expensify-open-source to discuss. Thanks!

@joekaufmanexpensify
Copy link
Contributor

Pending internal proposal sign off

@melvin-bot melvin-bot bot removed the Overdue label Feb 12, 2024
@mvtglobally
Copy link

Issue not reproducible during KI retests. (First week)

@joekaufmanexpensify
Copy link
Contributor

@mvtglobally I just tried again on my end and can still reproduce.

@joekaufmanexpensify
Copy link
Contributor

@iwiznia could you sign off on this proposal when you have a sec?

@joekaufmanexpensify
Copy link
Contributor

Still pending engineering sign off

@joekaufmanexpensify
Copy link
Contributor

Bumped 1:1

@iwiznia
Copy link
Contributor

iwiznia commented Feb 15, 2024

So sorry for the radio silence, I had a bad filter in my emails and this one got caught in it, so I was not seeing any of the messages or pings 😬

Proposal looks good to me.

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Feb 15, 2024
Copy link

melvin-bot bot commented Feb 15, 2024

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

Offer link
Upwork job

Copy link

melvin-bot bot commented Feb 15, 2024

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

@joekaufmanexpensify
Copy link
Contributor

@tienifr is there an ETA for the PR here?

@tienifr
Copy link
Contributor

tienifr commented Feb 16, 2024

@joekaufmanexpensify I'll raise the PR in 1-2 hours

@tienifr
Copy link
Contributor

tienifr commented Mar 1, 2024

@joekaufmanexpensify PR hit production. Melvin is malfunctioning. Please add HOLD for payment label.

@joekaufmanexpensify joekaufmanexpensify changed the title [$500] Distance - Distance request preview in the main chat is grayed out offline when created online [hold for payment 2024-03-06] [$500] Distance - Distance request preview in the main chat is grayed out offline when created online Mar 4, 2024
@joekaufmanexpensify
Copy link
Contributor

done!

@joekaufmanexpensify
Copy link
Contributor

Payment due today. We need to make the following payments:

@joekaufmanexpensify
Copy link
Contributor

@fedirjh $500 sent and contract ended

@joekaufmanexpensify
Copy link
Contributor

@tienifr $500 sent and contract ended

@joekaufmanexpensify
Copy link
Contributor

All set!

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. Engineering External Added to denote the issue can be worked on by a contributor Reviewing Has a PR in review Weekly KSv2
Projects
None yet
Development

No branches or pull requests

8 participants