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-07-26] [$1000] Web - Wrong information is shown if we create a group with descending order for the names of the users #22118

Closed
1 of 6 tasks
kbecciv opened this issue Jul 3, 2023 · 43 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

@kbecciv
Copy link

kbecciv commented Jul 3, 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. Go to staging dot on web chrome
  2. Click on FAB icon and click on new group
  3. (Important step), Select two users but in the descending order of the first letter of their email. (For example if you have two users with an email [email protected] and [email protected]), you need to first select the [email protected] and then finally you need to select the [email protected], so that you select the users in the descending order of the first character of their emails.
  4. Create a group
  5. You can see a welcome message 'This is the beginning of...."
  6. Click on both the users email present on the above welcome message and notice that user details are wrong. Both details gets exchanged.

Expected Result:

Correct details should be shown if we create a group in descending order for the email of the users

Actual Result:

Wrong information is shown if we create a group with descending order for the emails of the users

Workaround:

Unknown

Platforms:

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

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

Version Number: 1.3.35-5
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

error-2023-07-02_12.04.57.mp4
Recording.3380.mp4

Expensify/Expensify Issue URL:
Issue reported by: @priya-zha
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1688278732228069

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~015a2987433c41d846
  • Upwork Job ID: 1677068596844310528
  • Last Price Increase: 2023-07-06
@kbecciv kbecciv added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jul 3, 2023
@eh2077
Copy link
Contributor

eh2077 commented Jul 3, 2023

Proposal

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

Wrong information is shown if we create a group with descending order for the names of the users.

What is the root cause of that problem?

The array displayNamesWithTooltips

const displayNamesWithTooltips = ReportUtils.getDisplayNamesWithTooltips(
OptionsListUtils.getPersonalDetailsForAccountIDs(participantAccountIDs, props.personalDetails),
isMultipleParticipant,
);

is created from object

OptionsListUtils.getPersonalDetailsForAccountIDs(participantAccountIDs, props.personalDetails),

So the root cause of this issue is that participantAccountIDs[index] is possibly not match with displayNamesWithTooltips[index].accountID

{_.map(displayNamesWithTooltips, ({displayName, pronouns, accountID}, index) => (
<Text key={`${displayName}${pronouns}${index}`}>
<UserDetailsTooltip accountID={accountID}>
<Text
style={[styles.textStrong]}
onPress={() => {
const accountDetails = props.personalDetails[participantAccountIDs[index]];
if (accountDetails && accountDetails.accountID) {
Navigation.navigate(ROUTES.getProfileRoute(accountDetails.accountID));
}

, which navigates to wrong profile page.

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

To fix this issue, we should use the accountID from displayNamesWithTooltips. We can change

onPress={() => {
const accountDetails = props.personalDetails[participantAccountIDs[index]];
if (accountDetails && accountDetails.accountID) {
Navigation.navigate(ROUTES.getProfileRoute(accountDetails.accountID));
}
}}

to

onPress={() => Navigation.navigate(ROUTES.getProfileRoute(accountID))}

What alternative solutions did you explore? (Optional)

N/A

@melvin-bot
Copy link

melvin-bot bot commented Jul 3, 2023

Looks like something related to react-navigation may have been mentioned in this issue discussion.

As a reminder, please make sure that all proposals are not workarounds and that any and all attempt to fix the issue holistically have been made before proceeding with a solution. Proposals to change our DeprecatedCustomActions.js files should not be accepted.

Feel free to drop a note in #expensify-open-source with any questions.

@melvin-bot
Copy link

melvin-bot bot commented Jul 3, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 3, 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

@esh-g
Copy link
Contributor

esh-g commented Jul 3, 2023

Proposal

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

Wrong information is shown if we create a group with descending order for the names of the users.

What is the root cause of that problem?

In this code:

style={[styles.textStrong]}
onPress={() => {
const accountDetails = props.personalDetails[participantAccountIDs[index]];
if (accountDetails && accountDetails.accountID) {
Navigation.navigate(ROUTES.getProfileRoute(accountDetails.accountID));
}
}}

We are getting the account details from by using the map index from participantAccountIDs. But participantAccountIDs array is not sorted in accordance with the displayNamesWithTooltips array which causes this discrepancy.

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

We should get the account details from the correct account ID. For that we can change line 104 to the following:

const accountDetails = props.personalDetails[accountID];

It is important that we change this line and not line 106 because if the accountDetails for the first account exist and for the second account doesn't, we will still be able to navigate to the account ID even if accountDetails don't exist.

What alternative solutions did you explore? (Optional)

N/A

@melvin-bot melvin-bot bot added the Overdue label Jul 5, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 6, 2023

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

@sonialiap
Copy link
Contributor

Triaging to external

@melvin-bot melvin-bot bot removed the Overdue label Jul 6, 2023
@sonialiap sonialiap added the External Added to denote the issue can be worked on by a contributor label Jul 6, 2023
@melvin-bot melvin-bot bot changed the title Web - Wrong information is shown if we create a group with descending order for the names of the users [$1000] Web - Wrong information is shown if we create a group with descending order for the names of the users Jul 6, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 6, 2023

Job added to Upwork: https://www.upwork.com/jobs/~015a2987433c41d846

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

melvin-bot bot commented Jul 6, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 6, 2023

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

@Santhosh-Sellavel
Copy link
Collaborator

Unable to reproduce this

@priya-zha
Copy link

@Santhosh-Sellavel During the time of selecting the user, you need to select the users based on the descending order of their first letter of their emails. I'm still able to reproduce it. Here's the video. You can try using the emails given in the video for example.

error-2023-07-10_11.03.50.mp4

@eh2077
Copy link
Contributor

eh2077 commented Jul 10, 2023

@Santhosh-Sellavel Yes, sometimes we maybe unable to reproduce it because the order of object keys(accountID) can be same as the order of IDs in the array. You can try to use the two emails, [email protected] and [email protected], to reproduce it.

@Santhosh-Sellavel
Copy link
Collaborator

Santhosh-Sellavel commented Jul 11, 2023

Thanks, yeah I can reproduce.

@eh2077's Proposal looks good to me as it's straightforward. UserDetailsTooltip is populated using the same accountID and displayName for which the tooltip is added also comes from the same object, So it makes sense!

C+ Reviewed
🎀 👀 🎀

@melvin-bot
Copy link

melvin-bot bot commented Jul 11, 2023

Triggered auto assignment to @dangrous, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

@esh-g
Copy link
Contributor

esh-g commented Jul 11, 2023

@Santhosh-Sellavel Just wanted to inquire if you want the change to be at line 104 or 106... because the accountDetails would still be mismatched if we use participantAccountIDs[index]... as suggested here: #22118 (comment)

@Santhosh-Sellavel
Copy link
Collaborator

As per @eh2077's proposal, we will be updating the onPress callback to remove unnecessary computation and use the available accountID straightway.

@esh-g
Copy link
Contributor

esh-g commented Jul 11, 2023

@Santhosh-Sellavel The profile route will not exist if the accountID is not added to props.personalDetails so, if the user is not present in that, it will navigate to Not Found screen.. Please correct me if I'm wrong, but maybe the computation is required..

@esh-g
Copy link
Contributor

esh-g commented Jul 11, 2023

The accountDetails check was introduced in this PR: https://github.com/Expensify/App/pull/20612/files

@Santhosh-Sellavel
Copy link
Collaborator

Santhosh-Sellavel commented Jul 11, 2023

@Santhosh-Sellavel The profile route will not exist if the accountID is not added to props.personalDetails so, if the user is not present in that, it will navigate to Not Found screen.. Please correct me if I'm wrong, but maybe the computation is required..

I don't see the point here, is there a scenario where it may fail without computation let me know.

But AFAIK, displayNamesWithTooltips is the array we used to show the user names in the welcome. And it's prepared using participantAccountIDs of the report and personalDetails so we will always have everything required!

@eh2077
Copy link
Contributor

eh2077 commented Jul 12, 2023

@Santhosh-Sellavel The PR #22757 is ready for review, thanks.

@dangrous
Copy link
Contributor

merged, will be deployed shortly!

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Daily KSv2 labels Jul 19, 2023
@melvin-bot melvin-bot bot changed the title [$1000] Web - Wrong information is shown if we create a group with descending order for the names of the users [HOLD for payment 2023-07-26] [$1000] Web - Wrong information is shown if we create a group with descending order for the names of the users Jul 19, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jul 19, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 19, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 19, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.42-26 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-07-26. 🎊

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

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 Jul 19, 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:

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

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Jul 25, 2023
@sonialiap
Copy link
Contributor

sonialiap commented Jul 26, 2023

@priya-zha report ($250) - paid ✔️
@eh2077 fix, bonus ($1500) - paid ✔️
@Santhosh-Sellavel review, bonus ($1500) - please request in NewDot and complete the checklist

@melvin-bot melvin-bot bot added the Overdue label Jul 28, 2023
@dangrous
Copy link
Contributor

Hey @Santhosh-Sellavel do you think we can get that checklist out soon? Thanks!

@melvin-bot melvin-bot bot removed the Overdue label Jul 28, 2023
@Santhosh-Sellavel
Copy link
Collaborator

Santhosh-Sellavel commented Jul 28, 2023

We can particularly point out a single PR that caused this. So I think we can skip the checklist here, the issue itself is less likely than before and we won't be needing the Regression Tests either, thanks!

Let me know if you differ @dangrous, thanks!

@Santhosh-Sellavel
Copy link
Collaborator

Santhosh-Sellavel commented Jul 28, 2023

I'm yet to raise please keep that open until Payment Request & Approval, thanks!

@Santhosh-Sellavel
Copy link
Collaborator

Request $1.5K on ND

@JmillsExpensify
Copy link

Reviewed details for @Santhosh-Sellavel. These details are accurate based on summary from Business Reviewer and are now approved for payment in NewDot.

@melvin-bot melvin-bot bot added the Overdue label Jul 31, 2023
@dangrous
Copy link
Contributor

It's a little hard to tell in the history whether or not there's a specific PR that may have caused this, I looked through the ReportWelcomeText history and didn't find anything particularly relevant. This one maybe? But, there might be a PR elsewhere that changed how the participants were organized (so the index didn't work anymore)?

Do we want to add a test that's essentially the same as the QA steps in the PR? Or @Santhosh-Sellavel are you saying we already have that?

@melvin-bot melvin-bot bot removed the Overdue label Jul 31, 2023
@Santhosh-Sellavel
Copy link
Collaborator

@dangrous I think this should be part of the basics. I guess we have it already. If not let's just go with this from QA PR steps!

Steps

  1. Open the app and click FAB to create a group
  2. Search email [email protected] and select it
  3. Search for another email [email protected] and select it
  4. Click create group button to create a group
  5. In the group chat, click welcome message email [email protected]
  6. Verify that it opens the profile page of [email protected]
  7. Click welcome message email [email protected]
  8. Verify that it opens the profile page of [email protected]

@dangrous
Copy link
Contributor

dangrous commented Aug 1, 2023

Yeah @sonialiap let's request adding the above test, but call out to Applause that something similar might exist already? Thank you!

@melvin-bot melvin-bot bot added the Overdue label Aug 3, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 4, 2023

@dangrous, @sonialiap, @Santhosh-Sellavel, @eh2077 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@sonialiap
Copy link
Contributor

Regression test request opened

@melvin-bot melvin-bot bot removed the Overdue label Aug 8, 2023
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