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 checklist][$1000] Web - 'Hmm... it's not here' page is displayed on visiting profile of new user during request money #22691

Closed
1 of 6 tasks
kbecciv opened this issue Jul 11, 2023 · 58 comments
Assignees
Labels
Bug Something is broken. Auto assigns a BugZero manager. External Added to denote the issue can be worked on by a contributor Weekly KSv2

Comments

@kbecciv
Copy link

kbecciv commented Jul 11, 2023

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Action Performed:

  1. Open the app
  2. Click on plus and click on Request money
  3. Enter any amount and continue
  4. Search for new user eg: new34566+333@gmail.com
  5. Select the result and click on continue
  6. Click on the avatar and observe that app displays 'Hmm its not here' page in place of user details

Expected Result:

App should also display user details page on click of avatar

Actual Result:

After clicking avatar, it displays 'Hmm its not here' page in request money flow

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

new.user.tooltip.and.details.page.issue.mp4
Recording.3557.mp4

Expensify/Expensify Issue URL:
Issue reported by: @dhanashree-sawant
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1689083906726459

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~010b086092b3e04fff
  • Upwork Job ID: 1679016813331095552
  • 2023-07-26
  • Automatic offers:
    • dukenv0307 | Contributor | 25808235
    • dhanashree-sawant | Reporter | 25808237
@kbecciv kbecciv added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jul 11, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 11, 2023

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

@melvin-bot
Copy link

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

@c3024
Copy link
Contributor

c3024 commented Jul 11, 2023

Proposal

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

Tooltip shows only avatar and no login or display name in MoneyRequestConfirmationList page. Clicking on the user returns a Hmm, it ’s not there page.

What is the root cause of that problem?

Root cause of the problem is the new user obtained from getOptions is nowhere merged in personalDetailsList in Onyx. So, when we find the details of this new user in personalDetails, it returns nothing.

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

So, we need to update the personalDetails on clicking the new user option in MoneyRequestParticipants selector.
It happens to be the
https://github.com/Expensify/App/blob/17d1c3dc1f16428802b151ac069db43f27a93aad/src/libs/actions/IOU.js#L1391C1-L1393C2
Here, we add before the IOU merge in the above setMoneyRequestParticipamts function.

 _.each(participants, (participant) => {
        if (_.keys(allPersonalDetails).includes(participant.accountID)) {
            return;
        }
        Onyx.merge(ONYXKEYS.PERSONAL_DETAILS_LIST, {
            [participant.accountID]: {
                accountID: participant.accountID,
                avatar: UserUtils.getDefaultAvatarURL(participant.accountID),
                displayName: participant.displayName || participant.login,
                login: participant.login,
            },
        })});

and get allPersonalDetails by adding this also in IOU

let allPersonalDetails = {};
Onyx.connect({
    key: ONYXKEYS.PERSONAL_DETAILS_LIST,
    callback: (val) => {
        allPersonalDetails = val;
    },
});

This merges the new user’s details in personalDetails and the tooltip appears and clicking on avatar/user also takes to the page.

What alternative solutions did you explore? (Optional)

Result
Screen.Recording.2023-07-12.at.12.17.32.PM.mov

@multijump
Copy link
Contributor

Proposal

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

Tooltip displays only avatar and 'Hmm its not here' page is displayed on visiting profile of new user during request money

What is the root cause of that problem?

  1. Tooltip's RC
    We generate participants list from createOption in OptionsListUtils.js
    When get avatar here, createOption calls ReportUtils.getIcons.
    result.icons = ReportUtils.getIcons(report, personalDetails, UserUtils.getAvatar(personalDetail.avatar, personalDetail.accountID), false, personalDetail.login, personalDetail.accountID);

    createOption pass personalDetail.login and personalDetail.accountID but actually, there is no parameters for these values.
    function getIcons(report, personalDetails, defaultIcon = null, isPayer = false) {

    If participant is the non-exist user in DB, there is not any report so in this case, follow code bloc execute.
    if (_.isEmpty(report)) {
        const fallbackIcon = {
            source: defaultIcon || Expensicons.FallbackAvatar,
            type: CONST.ICON_TYPE_AVATAR,
            name: '',
            id: -1,
        };
        return [fallbackIcon];
    }

That's why tooltip doesn't have description.

  1. Profile Issue's RC
    if participant is the non-exist user in DB, Onyx send the optimisticData with random generated accountId.
    When click the participant, it navigate to user profile.
    const navigateToUserDetail = (option) => {
        if (!option.accountID) {
            return;
        }
        Navigation.navigate(ROUTES.getProfileRoute(option.accountID));
    };

But this option.accountID is randomly generated so can't get correct profile data from this fake accountID.

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

  1. Tooltip Issue
    We can add simply user login and accountID in getIcons function.
function getIcons(report, personalDetails, defaultIcon = null, isPayer = false, login = '', accountID = undefined) {
    if (_.isEmpty(report)) {
        const fallbackIcon = {
            source: defaultIcon || Expensicons.FallbackAvatar,
            type: CONST.ICON_TYPE_AVATAR,
            name: login,
            id: accountID,
        };
        return [fallbackIcon];
    }
  1. Profile Issue
  • We need to determine the expected result in this case.
  • There is no entry in DB in this case, so can't show profile info properly.

What alternative solutions did you explore? (Optional)

N/A
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

@greg-schroeder
Copy link
Contributor

The tooltip part of this is a duplicate of #22485 / #22062

@greg-schroeder greg-schroeder changed the title Web - Tooltip displays only avatar and 'Hmm its not here' page is displayed on visiting profile of new user during request money Web - 'Hmm... it's not here' page is displayed on visiting profile of new user during request money Jul 12, 2023
@greg-schroeder
Copy link
Contributor

I updated the OP/issue title to focus on the missing details in the user profile

@greg-schroeder greg-schroeder added the External Added to denote the issue can be worked on by a contributor label Jul 12, 2023
@melvin-bot melvin-bot bot changed the title Web - 'Hmm... it's not here' page is displayed on visiting profile of new user during request money [$1000] Web - 'Hmm... it's not here' page is displayed on visiting profile of new user during request money Jul 12, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 12, 2023

Job added to Upwork: https://www.upwork.com/jobs/~010b086092b3e04fff

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

melvin-bot bot commented Jul 12, 2023

Current assignee @greg-schroeder is eligible for the External assigner, not assigning anyone new.

@melvin-bot
Copy link

melvin-bot bot commented Jul 12, 2023

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

@dukenv0307
Copy link
Contributor

dukenv0307 commented Jul 12, 2023

Proposal

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

"Hmm... its not here" page is displayed when splitting a bill or requesting money from an account not interacted before

What is the root cause of that problem?

When we choose a contact which we have not interacted before, we create a temporary option with a random accountID that is generated by generateAccountID function.

But it is an invalid accountID and not present in personalDetails. After openPublicProfilePage API is called, the data returns with accountID is -1.

return Math.floor(Math.random() * 2 ** 21) * 2 ** 32 + Math.floor(Math.random() * 2 ** 32);

That makes details empty and not found page displays

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

We can create a function in PersonalDetailsUtils like isOptimisticPersonalDetail with a param is accountID to check if the personal detail of the accountID is empty or just optimistic personal detail

And then we should disable navigating the profile page or display not found page for the optimistic personal detail by using this function

const navigateToUserDetail = (option) => {
if (!option.accountID) {

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

Navigation.navigate(ROUTES.getProfileRoute(participantAccountIDs[0]));

Navigation.navigate(ROUTES.getProfileRoute(option.accountID));

Navigation.navigate(ROUTES.getProfileRoute(accountID));

Navigation.navigate(ROUTES.getProfileRoute(item.accountID));

What alternative solutions did you explore? (Optional)

@dukenv0307
Copy link
Contributor

@greg-schroeder I think tooltip issue here is not the same root cause with #22485 and #22062

@greg-schroeder
Copy link
Contributor

@deetergp seemed to think it was per the discussion here, not sure though: https://expensify.slack.com/archives/C049HHMV9SM/p1689083906726459

@sobitneupane
Copy link
Contributor

Profile page not found
We should use the same way that BE used to generate accountID.
Or We could navigate to detailRoute which will display the detail of the temporary option even it exists or not instead of profileRoute

@dukenv0307 What is preventing the ProfilePage to show users with accountID -1 ? Can we update ProfilePage to show those users?

@dukenv0307
Copy link
Contributor

dukenv0307 commented Jul 13, 2023

@sobitneupane When we select a user that is a new user in request money page, personal detail is not present in PersonalDetailsList.
And then, because the accountID that we passed in payload of OpenPublicProfile is fake, BE returns data with accountID -1.

That makes details empty.

const details = lodashGet(props.personalDetails, accountID, ValidationUtils.isValidAccountRoute(accountID) ? {} : {isloading: false});

Can we update ProfilePage to show those users?

I don't think we can update this page to show those users because before we create request money, detail of those users doesn't in personalDetailList in Onyx.

@sobitneupane
Copy link
Contributor

Can we pass some fallback data for such cases where BE is unable to send data?

@dukenv0307
Copy link
Contributor

We could navigate to detailRoute which will display the detail of the temporary option even it exists or not instead of profileRoute

@sobitneupane Do you think about my suggestion here.

@dukenv0307
Copy link
Contributor

Can we pass some fallback data for such cases where BE is unable to send data?

If we want to pass some fallback, we should create an ONYXKEYS to store the fallback data. And then before we navigate to this page, we should store fallback in Onyx

@sobitneupane
Copy link
Contributor

@multijump
Copy link
Contributor

multijump commented Jul 13, 2023

Profile page not found
We should use the same way that BE used to generate accountID.
Or We could navigate to detailRoute which will display the detail of the temporary option even it exists or not instead of profileRoute

@dukenv0307 What is preventing the ProfilePage to show users with accountID -1 ? Can we update ProfilePage to show those users?

I think it is not good to update the ProfilePage to show users with accountID -1.
It would be good to update accountID -1 to optimistic accountID which generated randomly.

@melvin-bot melvin-bot bot added the Overdue label Jul 17, 2023
@greg-schroeder
Copy link
Contributor

Discussion appears to be ongoing

@melvin-bot melvin-bot bot removed the Overdue label Jul 17, 2023
@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Aug 4, 2023
@melvin-bot melvin-bot bot changed the title [$1000] Web - 'Hmm... it's not here' page is displayed on visiting profile of new user during request money [HOLD for payment 2023-08-14] [$1000] Web - 'Hmm... it's not here' page is displayed on visiting profile of new user during request money Aug 7, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 7, 2023

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

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Aug 7, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 7, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.50-3 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-08-14. 🎊

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

For reference, here are some details about the assignees on this issue:

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 Aug 7, 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:

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

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Aug 9, 2023
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2023-08-14] [$1000] Web - 'Hmm... it's not here' page is displayed on visiting profile of new user during request money [HOLD for payment 2023-08-16] [HOLD for payment 2023-08-14] [$1000] Web - 'Hmm... it's not here' page is displayed on visiting profile of new user during request money Aug 9, 2023
@melvin-bot
Copy link

melvin-bot bot commented Aug 9, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.51-2 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-08-16. 🎊

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

For reference, here are some details about the assignees on this issue:

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 Aug 9, 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:

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

@greg-schroeder greg-schroeder changed the title [HOLD for payment 2023-08-16] [HOLD for payment 2023-08-14] [$1000] Web - 'Hmm... it's not here' page is displayed on visiting profile of new user during request money [HOLD for payment 2023-08-16][$1000] Web - 'Hmm... it's not here' page is displayed on visiting profile of new user during request money Aug 10, 2023
@greg-schroeder
Copy link
Contributor

greg-schroeder commented Aug 16, 2023

Issue Participants:

Issue reported by: @dhanashree-sawant ($250)
Contributor: @dukenv0307 ($500)
C+: @sobitneupane ($500)

There was a regression here: #22691 (comment)

@greg-schroeder
Copy link
Contributor

Sent payments/offers. Remaining payments will be done via NewDot. All that's left is the checklist @sobitneupane

@greg-schroeder greg-schroeder changed the title [HOLD for payment 2023-08-16][$1000] Web - 'Hmm... it's not here' page is displayed on visiting profile of new user during request money [HOLD for checklist][$1000] Web - 'Hmm... it's not here' page is displayed on visiting profile of new user during request money Aug 17, 2023
@greg-schroeder greg-schroeder removed the Awaiting Payment Auto-added when associated PR is deployed to production label Aug 17, 2023
@sobitneupane
Copy link
Contributor

sobitneupane commented Aug 21, 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:

  • [@sobitneupane] The PR that introduced the bug has been identified. Link to the PR:

#20746

  • [@sobitneupane] 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:

#20746 (comment)

  • [@sobitneupane] 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:

Not required.

  • [@sobitneupane] Determine if we should create a regression test for this bug.

Yes

  • [@sobitneupane] 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.

#22691 (comment)

@sobitneupane
Copy link
Contributor

Regression Test Proposal

  1. Login with any account
  2. Go offline
  3. Create a new chat with the user that isn't a recent contact
  4. In the report, click the header
  5. Verify that the cursor is disabled and can not open profile page
  6. Click on the display of the user in welcome message text
  7. Verify that the cursor is text and can not open profile page
  8. Create a group chat with the user that isn't a recent contact
  9. In the report, click the header to open participant page
  10. Click on the avatar of this user
  11. Verify that the cursor is disable and can not open profile page
  12. Go online and verify that the cursor is changed to pointer and can open profile page
  13. Go to FAB > request money
  14. Enter any amount to go to the next step
  15. Search and select the user that isn't a recent contact
  16. In confirm page, verify that the cursor is disabled when hovering over the avatar and can not open profile page

Do we agree 👍 or 👎

@sobitneupane
Copy link
Contributor

Requested payment on newDot

#22691 (comment)

@greg-schroeder
Copy link
Contributor

Thanks @sobitneupane! Took care of payments, filing regression test, closing.

@JmillsExpensify
Copy link

Reviewed the details for @sobitneupane. $500 approved for payment in NewDot based on BZ summary.

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

No branches or pull requests

9 participants