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-12-05] [$250] Chat-Hidden is shown briefly on sending @new expensifail user #51186

Closed
2 of 8 tasks
izarutskaya opened this issue Oct 21, 2024 · 21 comments
Closed
2 of 8 tasks
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production 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

@izarutskaya
Copy link

izarutskaya commented Oct 21, 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: V9. 0.51-2
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: "Hidden" is shown in Hybrid app, it doesn't disappear
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Issue reported by: Applause-Internal team

Action Performed:

  1. Go to https://staging.new.expensify.com/home
  2. Open self DM
  3. Enter @ and a new non existing expensifail account eg: @applausetester+1nonew@applause.expensifail.com
  4. Send the message

Expected Result:

Hidden must not be shown briefly on sending @new expensifail user.

Actual Result:

Hidden is shown briefly on sending @new expensifail user.

Workaround:

Unknown

Platforms:

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

  • Android: Standalone
  • Android: HybridApp
  • Android: mWeb Chrome
  • iOS: Standalone
  • iOS: HybridApp
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Bug6640933_1729511637519.Screenrecorder-2024-10-21-17-10-22-360_compress_1.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021849163258326584198
  • Upwork Job ID: 1849163258326584198
  • Last Price Increase: 2024-10-23
Issue OwnerCurrent Issue Owner: @johncschuster
@izarutskaya izarutskaya added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Oct 21, 2024
Copy link

melvin-bot bot commented Oct 21, 2024

Triggered auto assignment to @johncschuster (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.

@bernhardoj
Copy link
Contributor

Proposal

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

Hidden is shown briefly when mentioning a user that we never chat before.

What is the root cause of that problem?

When we send a mention a receive the BE response, it will merge a new data for the mention accountID and the personal details. If the accountID is available, we look for it in the personal details list.

if (!isEmpty(htmlAttribAccountID)) {
const user = personalDetails[htmlAttribAccountID];
accountID = parseInt(htmlAttribAccountID, 10);
mentionDisplayText = LocalePhoneNumber.formatPhoneNumber(user?.login ?? '') || PersonalDetailsUtils.getDisplayNameOrDefault(user);
mentionDisplayText = getShortMentionIfFound(mentionDisplayText, htmlAttributeAccountID, user?.login ?? '') ?? '';
navigationRoute = ROUTES.PROFILE.getRoute(htmlAttribAccountID, Navigation.getReportRHPActiveRoute());

However, the personal details list from the hook here is not updated yet.

const personalDetails = usePersonalDetails() || CONST.EMPTY_OBJECT;

So, user will be undefined and because of that, the displayName is undefined too and we fallback to Hidden briefly.

return defaultValue || (shouldFallbackToHidden ? hiddenTranslation : '');

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

We can check if both accountID and the personal details is available before using it.

if (!isEmpty(htmlAttribAccountID)) {
const user = personalDetails[htmlAttribAccountID];

if (!isEmpty(htmlAttribAccountID) && personalDetails[htmlAttribAccountID]) {
    const user = personalDetails[htmlAttribAccountID];

OR

We can use useOnyx hook instead which from my testing, updated the same time as the mention (action) accountID.

const personalDetails = usePersonalDetails() || CONST.EMPTY_OBJECT;

OR do both

@melvin-bot melvin-bot bot added the Overdue label Oct 23, 2024
@johncschuster johncschuster added the External Added to denote the issue can be worked on by a contributor label Oct 23, 2024
@melvin-bot melvin-bot bot changed the title Chat-Hidden is shown briefly on sending @new expensifail user [$250] Chat-Hidden is shown briefly on sending @new expensifail user Oct 23, 2024
Copy link

melvin-bot bot commented Oct 23, 2024

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

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

melvin-bot bot commented Oct 23, 2024

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

@melvin-bot melvin-bot bot removed the Overdue label Oct 23, 2024
@rushatgabhane
Copy link
Member

@bernhardoj's proposal LGTM
we should do both, right?

🎀 👀 🎀

Copy link

melvin-bot bot commented Oct 23, 2024

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

@MariaHCD
Copy link
Contributor

@bernhardoj's proposal looks good to me too but do is it necessary to do both?

@rushatgabhane
Copy link
Member

if we don't do both, it might temporarily show hidden until the value is resolved. Right?

cc @bernhardoj

@bernhardoj
Copy link
Contributor

Doing one of them is actually enough.

We can use useOnyx hook instead which from my testing, updated the same time as the mention (action) accountID.

I'm also suggesting doing both just in case the above isn't true anymore in the future. I think the 1st solution is the safest, but since replacing it with useOnyx is receiving the new value faster, I think there is no harm in doing both.

@MariaHCD
Copy link
Contributor

Great, thanks for clarifying. Doing both sounds 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 Oct 25, 2024
@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Oct 25, 2024
@bernhardoj
Copy link
Contributor

PR is ready

cc: @rushatgabhane

@muttmuure muttmuure moved this to MEDIUM in [#whatsnext] #quality Oct 28, 2024
@melvin-bot melvin-bot bot removed the Weekly KSv2 label Nov 18, 2024
@melvin-bot melvin-bot bot added the Monthly KSv2 label Nov 18, 2024
Copy link

melvin-bot bot commented Nov 18, 2024

This issue has not been updated in over 15 days. @johncschuster, @MariaHCD, @rushatgabhane, @bernhardoj eroding to Monthly issue.

P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Monthly KSv2 labels Nov 28, 2024
@melvin-bot melvin-bot bot changed the title [$250] Chat-Hidden is shown briefly on sending @new expensifail user [HOLD for payment 2024-12-05] [$250] Chat-Hidden is shown briefly on sending @new expensifail user Nov 28, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Nov 28, 2024
Copy link

melvin-bot bot commented Nov 28, 2024

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

Copy link

melvin-bot bot commented Nov 28, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.67-9 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 2024-12-05. 🎊

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

Copy link

melvin-bot bot commented Nov 28, 2024

@rushatgabhane @johncschuster @rushatgabhane The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

@johncschuster
Copy link
Contributor

johncschuster commented Dec 2, 2024

BugZero Checklist:

  • [Contributor] Classify the bug:
Bug classification

Source of bug:

  • 1a. Result of the original design (eg. a case wasn't considered)
  • 1b. Mistake during implementation
  • 1c. Backend bug
  • 1z. Other:

Where bug was reported:

  • 2a. Reported on production
  • 2b. Reported on staging (deploy blocker)
  • 2c. Reported on both staging and production
  • 2d. Reported on a PR
  • 2z. Other:

Who reported the bug:

  • 3a. Expensify user
  • 3b. Expensify employee
  • 3c. Contributor
  • 3d. QA
  • 3z. Other:
  • [Contributor] 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:

  • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source 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:

  • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

Regression Test Proposal Template
  • [BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.

    Link to issue:

Regression Test Proposal

Precondition:

Test:

Do we agree 👍 or 👎

@rushatgabhane
Copy link
Member

  1. 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: The issue seems pretty dated. I went back ~1.5 years. It is hard to pin point a PR.

  2. If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source 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 critical.

  3. If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

Yes if not already --

            1. Open any chat
            2. Mention a user that is not in your contact list (unknown user)
            3. Verify the mention doesn't change to @Hidden briefly

@bernhardoj
Copy link
Contributor

Requested in ND.

@johncschuster
Copy link
Contributor

Payment Summary:

Contributor: @bernhardoj due $250 via NewDot
Contributor+: @rushatgabhane due $250 via NewDot

@github-project-automation github-project-automation bot moved this from MEDIUM to Done in [#whatsnext] #quality Dec 3, 2024
@JmillsExpensify
Copy link

$250 approved for @bernhardoj

@garrettmknight
Copy link
Contributor

$250 approved for @rushatgabhane

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

No branches or pull requests

7 participants