App icon indicating copy to clipboard operation
App copied to clipboard

[$1000] GBR and RBR show up at the same time in the LHN

Open kavimuru opened this issue 1 year ago β€’ 16 comments

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. Request money from userA to userB
  2. As userB notice the GBR indicator in the LHN
  3. Perform an action that will result in an error
  4. Notice that both GBR and RBR show up

Expected Result:

only one of GBR and RBR should show up at the same time

Actual result

There are two GBR and RBR shows up

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

Platforms:

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

  • [x] Android / native
  • [x] Android / Chrome
  • [x] iOS / native
  • [x] iOS / Safari
  • [x] MacOS / Chrome / Safari
  • [x] MacOS / Desktop

Version Number: 1.3.4 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 Notes/Photos/Videos: Any additional supporting documentation 1 Screenshot 2023-04-24 at 3 57 08 PM

Expensify/Expensify Issue URL: Issue reported by: @luacmartins Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1682348382322349

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01ca926e0b968c9e14
  • Upwork Job ID: 1650782173286518784
  • Last Price Increase: 2023-04-25

kavimuru avatar Apr 24 '23 20:04 kavimuru

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

MelvinBot avatar Apr 24 '23 20:04 MelvinBot

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

MelvinBot avatar Apr 24 '23 20:04 MelvinBot

Proposal

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

GBR and RBR show up at the same time in the LHN

What is the root cause of that problem?

We are showing both GBR, RBR from OptionRowLHN. So when a report has both request money and error, we will see both GBR and RBR appear. https://github.com/Expensify/App/blob/930352d64958603e50a51e32d834c34dbf1ad946/src/components/LHNOptionsList/OptionRowLHN.js#L203 https://github.com/Expensify/App/blob/930352d64958603e50a51e32d834c34dbf1ad946/src/components/LHNOptionsList/OptionRowLHN.js#L227

I can also reproduce on my end: Screenshot 2023-04-25 at 14 21 17

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

It depends which dot will have higher priority, I think RBR will have higher priority. So in case we want to fix this problem we should add a condition to show the GBR only when that report there's no error. So the condition to display the GBR inside OptionRowLHN will look like this:

// only show the GBR when there's no error
{_.isEmpty(optionItem.allReportErrors) && optionItem.hasOutstandingIOU && !optionItem.isIOUReportOwner && <Icon src={Expensicons.DotIndicator} fill={colors.green} />}

What alternative solutions did you explore? (Optional)

We can also create a common component for this DotIndicator to handle the issue because I notice that the red dot and green dot have difference size. So the DotIndicator component can look like:

if (showRedDot) {
  return <RedDot />
}
if (showGreenDot) {
  return <GreenDot />
}
return null;

hungvu193 avatar Apr 25 '23 07:04 hungvu193

Job added to Upwork: https://www.upwork.com/jobs/~01ca926e0b968c9e14

MelvinBot avatar Apr 25 '23 08:04 MelvinBot

Current assignee @anmurali is eligible for the External assigner, not assigning anyone new.

MelvinBot avatar Apr 25 '23 08:04 MelvinBot

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

MelvinBot avatar Apr 25 '23 08:04 MelvinBot

Current assignee @luacmartins is eligible for the External assigner, not assigning anyone new.

MelvinBot avatar Apr 25 '23 08:04 MelvinBot

Proposal

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

GBR and RBR show up at the same time in the LHN

What is the root cause of that problem?

https://github.com/Expensify/App/blob/930352d64958603e50a51e32d834c34dbf1ad946/src/components/LHNOptionsList/OptionRowLHN.js#L203-L212 https://github.com/Expensify/App/blob/930352d64958603e50a51e32d834c34dbf1ad946/src/components/LHNOptionsList/OptionRowLHN.js#L227 Because this report has both error and OutstandingIOU comments. So both GBR and RBR show up Optional: We should update the size of RBR to equal the size of GBR

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

We should add a condition if there is any error we should not display GBR like this

{optionItem.brickRoadIndicator !== CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR && optionItem.hasOutstandingIOU && !optionItem.isIOUReportOwner && <Icon src={Expensicons.DotIndicator} fill={colors.green} />}

What alternative solutions did you explore? (Optional)

dukenv0307 avatar Apr 25 '23 08:04 dukenv0307

I think from an information standpoint both of them are helpful and will give complete info

  • Green dot is expected to be a pending action
  • Red dot shows there might be an error, which is also informative

we should probably leave it as is.

If we are to remove one dot indicator then I think it should be the green one, thinking behind that an "error" should be a more serious case than a "pending" action.

huzaifa-99 avatar Apr 26 '23 10:04 huzaifa-99

I am going to tag @Expensify/design @shawnborton to confirm if we need do something about this here?

For me as a user, I am fine seeing both GBR and RBR (and as others have mentioned earlier), shows there was an error and there are some pending actions.

cc - @anmurali @luacmartins

mananjadhav avatar Apr 27 '23 07:04 mananjadhav

I think maybe we should bring this one to Slack for more discussion.

Part of me feels like you should only see one indicator at a time, and it should be the RBR indicator. cc @JmillsExpensify @trjExpensify for thoughts there

shawnborton avatar Apr 27 '23 14:04 shawnborton

This is possible scenario in current version:

4-OptionRowLHN

aimane-chnaif avatar Apr 27 '23 14:04 aimane-chnaif

Yeah, a couple of things here:

  • we should keep the pin/pencil icon together and not have an indicator in between them
  • red and green indicators should be the same size (20x20)
  • we should only show one indicator at a time

shawnborton avatar Apr 27 '23 14:04 shawnborton

Part of me feels like you should only see one indicator at a time, and it should be the RBR indicator. cc @JmillsExpensify @trjExpensify for thoughts there

Yup, agreed. When we introduced Pattern B we said errors (i.e red brick road) would take priority and we wouldn't show both. So in this case, the LHN would have a red dot for the error and once dismissed, it would have a green dot for the outstanding request to settle.

CC: @iwiznia

trjExpensify avatar Apr 27 '23 16:04 trjExpensify

Agreed

iwiznia avatar Apr 27 '23 16:04 iwiznia

I am not sure if this issue should be handled in https://github.com/Expensify/App/issues/17163 since they both require design changes and may conflict.

aimane-chnaif avatar Apr 27 '23 16:04 aimane-chnaif

I think @hungvu193's proposal is fine here as it covers the expected result. We can put this on hold until #17163 is merged. I can see we're fixing size there, not sure about conditional rendering of the brick messages.

cc- @luacmartins

mananjadhav avatar Apr 27 '23 21:04 mananjadhav

@mananjadhav I think we are only addressing size in that PR, so I don't think we need to hold on that. I think we can move forward with @hungvu193's proposal

luacmartins avatar Apr 28 '23 08:04 luacmartins

πŸ“£ @hungvu193 You have been assigned to this job by @luacmartins! Please apply to this job in Upwork 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 πŸ“–

MelvinBot avatar Apr 28 '23 08:04 MelvinBot

PR is ready (https://github.com/Expensify/App/pull/18137) @luacmartins @mananjadhav

hungvu193 avatar Apr 28 '23 09:04 hungvu193

@mananjadhav, @anmurali, @hungvu193, @luacmartins Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

melvin-bot[bot] avatar May 05 '23 20:05 melvin-bot[bot]

PR is deployed to staging. Will be soon deployed to production soon.

mananjadhav avatar May 05 '23 20:05 mananjadhav

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

melvin-bot[bot] avatar May 09 '23 03:05 melvin-bot[bot]

The solution for this issue has been :rocket: deployed to production :rocket: in version 1.3.12-0 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:

  • https://github.com/Expensify/App/pull/18137

If no regressions arise, payment will be issued on 2023-05-16. :confetti_ball:

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.

  • [x] External issue reporter - @luacmartins - Internal, no payment needed.
  • [x] Contributor that fixed the issue - @hungvu193 - $1000 + $500 (Speed bonus) = $1500
  • [x] Contributor+ that helped on the issue and/or PR - @mananjadhav - $1000 + $500 (Speed bonus) = $1500

Speed bonus assessment: Contributor hired on April 28 / PR merged on May 2 = two business days = Eligible

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[bot] avatar May 09 '23 03:05 melvin-bot[bot]

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:

  • [ ] [@mananjadhav] The PR that introduced the bug has been identified. Link to the PR:
  • [ ] [@mananjadhav] 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:
  • [ ] [@mananjadhav] 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:
  • [ ] [@mananjadhav] Determine if we should create a regression test for this bug.
  • [ ] [@mananjadhav] 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.
  • [ ] [@anmurali] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

melvin-bot[bot] avatar May 09 '23 03:05 melvin-bot[bot]

I think we need a regression test proposal to avoid having the same issue again.

Regression Test Proposal

  1. Open the chat in different windows as two users - self and userA.
  2. Pin the chat, and verify the Pin icon is showing in the LHN.
  3. Request money from userA
  4. Notice the GBR indicator in the LHN, and the Pin icon is hidden for the userA.
  5. Perform an action that will result in an error
  6. Verify that GBR is hidden and only RBR show up
  7. Also verify that GBR and RBR are of the same size 20px.

I am not able to decide if we treat this is as a Feature Request? I can see we added the GBR in this PR https://github.com/Expensify/App/commit/2c0f6dd850e3f5b945286bb8b83906ed4aae2837 but I don't see any regression test/QA related to RBR or any requirements. @luacmartins @anmurali any thoughts?

mananjadhav avatar May 16 '23 19:05 mananjadhav

@mananjadhav agree on adding a regression test, but I have a couple of comments.

  1. Notice the GBR indicator in the LHN, and the Pin icon is hidden.

I don't think this will happen because the GBR indicator shows only for the payer, not the person requesting money.

  1. Perform an action that will result in an error

We need to be more specific here. What action are we performing.

luacmartins avatar May 17 '23 13:05 luacmartins

I don't think this will happen because the GBR indicator shows only for the payer, not the person requesting money.

@luacmartins Good catch I editing multiple times to move from userA and userB. Please check if the update steps are fine.

We need to be more specific here. What action are we performing.

I mocked the API to throw the error. I am not sure if I have an easy way to perform an action to throw an error. do you have any suggestions?

mananjadhav avatar May 17 '23 14:05 mananjadhav

@mananjadhav maybe something like this would work?

  1. Open a chat in different windows as two users - userA and userB.
  2. As user B, pin the chat.
  3. Verify the Pin icon is showing in the LHN.
  4. As user A, request money from user B + > Request money
  5. As user B, verify the GBR indicator shows in the LHN and the Pin icon is hidden
  6. As user B, go offline and pay the request elsewhere
  7. As user A, delete the request
  8. As user B, come back online and verify that the pay request resulted in an error
  9. As user B, verify that GBR is hidden and only RBR show up
  10. Verify that GBR and RBR are of the same size

luacmartins avatar May 17 '23 14:05 luacmartins

Yes this looks good. Thanks for helping out here.

mananjadhav avatar May 17 '23 15:05 mananjadhav