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-12] [$1000] Web - Chat - Flagged attachment are collapsed when reacted with emojis #20810

Closed
1 of 6 tasks
kbecciv opened this issue Jun 15, 2023 · 50 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 Jun 15, 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. Login with user A and go to a chat with user B
  2. Send an attachment ( picture/pdf) to user B
  3. On user B, first flag the attachment as bullying. Next, ( this is an important step) click on the reveal message. Now react with any emojis
  4. Notice the attachment is now hidden.

Expected Result:

Flagged attachment should not be collapsed when reacted with emojis

Actual Result:

Flagged attachments are collapsed when reacted with emojis

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

Reproducible in staging?: yes

Reproducible in production?: yes

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

Screen.Recording.2023-06-08.at.3.13.21.PM.1.mov
Recording.724.mp4

Expensify/Expensify Issue URL:

Issue reported by: @ashimsharma10

Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1686217468053799

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0192768e5414216425
  • Upwork Job ID: 1670794643847507968
  • Last Price Increase: 2023-06-19
@kbecciv kbecciv added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jun 15, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 15, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jun 15, 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

@hungvu193
Copy link
Contributor

Seems regression from #20737
That's exact case that I mentioned, is this expected? @aimane-chnaif

@aimane-chnaif
Copy link
Contributor

aimane-chnaif commented Jun 15, 2023

It's not a regression. We agreed to restore hidden state back when refresh page. And this already happens in production, while that PR is on staging.
Though I am not able to reproduce this on latest main. Instead another weird bug happens which is not related to that PR:
Flagged attachment completely disappearing. And flagged text message isn't hidden at all.

@hungvu193
Copy link
Contributor

hungvu193 commented Jun 15, 2023

Seems this was logged before that pr hit stagging, I couldn't reproduce on latest main as well
I'm able to reproduce it after try to delete cache.

@ashimsharma10
Copy link

@hungvu193 are you sure the same issue mentioned above is reproduced?

@aimane-chnaif
Copy link
Contributor

I think there were another recent changes related to flag behavior. Maybe backend updates.
After some time, flag cancels.

Screen.Recording.2023-06-15.at.2.34.17.PM.mov

@melvin-bot melvin-bot bot added the Overdue label Jun 19, 2023
@muttmuure
Copy link
Contributor

I've been trying to reproduce this but I'm seeing that the message isn't being hidden at all

@melvin-bot melvin-bot bot removed the Overdue label Jun 19, 2023
@muttmuure
Copy link
Contributor

Ah OK it was just taking a while

@muttmuure
Copy link
Contributor

muttmuure commented Jun 19, 2023

OK yep this is reproducible - note it only happens with attachments, when you flag a comment using an option that removes the comment from view, and when you reveal the comment when it is hidden and add an emoji

@muttmuure muttmuure added the External Added to denote the issue can be worked on by a contributor label Jun 19, 2023
@melvin-bot melvin-bot bot changed the title Web - Chat - Flagged attachment are collapsed when reacted with emojis [$1000] Web - Chat - Flagged attachment are collapsed when reacted with emojis Jun 19, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 19, 2023

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

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

melvin-bot bot commented Jun 19, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jun 19, 2023

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

@mollfpr
Copy link
Contributor

mollfpr commented Jun 20, 2023

Thanks for the proposal @s-alves10

Could you elaborate on what backend should be fixed and the changes to solve this to remove the pendingHide and this.props.isSmallScreenWidth for the check?

Why this.props.isSmallScreenWidth fix this issue, while the issue is not only on the small screen?

@dummy-1111
Copy link
Contributor

@mollfpr

This issue was fixed by this commit e44d211

@mollfpr
Copy link
Contributor

mollfpr commented Jun 21, 2023

@s-alves10 I am still able to reproduce it in staging.

Screen.Recording.2023-06-20.at.23.09.28.mov

@dummy-1111
Copy link
Contributor

@mollfpr

Please check it on main branch. Maybe it was not deployed yet

@mollfpr
Copy link
Contributor

mollfpr commented Jun 21, 2023

@s-alves10 I can reproduce in the latest main (v1.3.30-0) after some time.

  1. Send an attachment to User B, e.g., a PDF
  2. On User B sent reaction to the PDF and flag the attachment as bullying
  3. On User A quickly add another reaction to the attachment and click on reveal message
Screen.Recording.2023-06-21.at.21.24.07.mov

@dummy-1111
Copy link
Contributor

Let me check. I'll update you soon

@dummy-1111
Copy link
Contributor

Proposal

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

Flagged attachment is hidden when reacting with emojis

What is the root cause of that problem?

We're now setting isHidden flag when latest moderation decision is pendingHide or hidden. This is correct. The problem is when this effect is called.

if (latestDecision.decision === CONST.MODERATION.MODERATOR_DECISION_PENDING_HIDE || latestDecision.decision === CONST.MODERATION.MODERATOR_DECISION_HIDDEN) {
setIsHidden(true);
}

As you can see above, we now call the effect when actionName or moderationDecisions changes, but moderationDecisions is an array(reference) and can change anytime. So this effect is called even when no moderationDecisions is changed. This is the root cause

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

We're interested in the value of moderationDecisions[0].decision. We should change the dependency of the effect.
Change the useEffect code block as follows

    const latestDecision = _.get(props, ['action', 'message', 0, 'moderationDecisions', 0, 'decision'], '');
    useEffect(() => {
        if (!props.action.actionName === CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT || _.isEmpty(latestDecision)) {
            return;
        }

        if (latestDecision === CONST.MODERATION.MODERATOR_DECISION_PENDING_HIDE || latestDecision === CONST.MODERATION.MODERATOR_DECISION_HIDDEN) {
            setIsHidden(true);
        }
        setModerationDecision(latestDecision);

    }, [latestDecision, props.action.actionName]);

This works as expected

What alternative solutions did you explore? (Optional)

@mollfpr
Copy link
Contributor

mollfpr commented Jun 23, 2023

Thanks @s-alves10 for the proposal. @muttmuure The proposal looks good to me 👍

🎀 👀 🎀 C+ reviewed!

@melvin-bot melvin-bot bot added the Awaiting Payment Auto-added when associated PR is deployed to production label Jul 5, 2023
@melvin-bot melvin-bot bot changed the title [$1000] Web - Chat - Flagged attachment are collapsed when reacted with emojis [HOLD for payment 2023-07-12] [$1000] Web - Chat - Flagged attachment are collapsed when reacted with emojis Jul 5, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jul 5, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 5, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 5, 2023

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

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

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

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Jul 11, 2023
@ashimsharma10
Copy link

Updates on this?

@mollfpr
Copy link
Contributor

mollfpr commented Jul 12, 2023

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

#19476

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

https://github.com/Expensify/App/pull/19476/files#r1261372039

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

I think the regression step should be enough. The reviewer will watch a useEffect dependency where it's already documented that we should reference the correct value for its change.

[@mollfpr] Determine if we should create a regression test for this bug.
[@mollfpr] 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.

  1. Login with users A and B on 2 devices
  2. A: Send an attachment(picture or pdf) to user B
  3. B: Flag the attachment as bullying
  4. B: Click on the revealed message to see the attachment
  5. B: React with any emojis
  6. Verify that the attachment is not hidden
  7. 👍 or 👎

@mollfpr
Copy link
Contributor

mollfpr commented Jul 12, 2023

I notice that the bonus calculation is not posted here.

The assignment is on Jun 29
PR merged Jun 30

@mollfpr
Copy link
Contributor

mollfpr commented Jul 14, 2023

Friendly bump @muttmuure

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

@mollfpr invited

@ashimsharma10 can you link your upwork profile, we have two Ashim S's in Upwork

@melvin-bot melvin-bot bot removed the Overdue label Jul 17, 2023
@mollfpr
Copy link
Contributor

mollfpr commented Jul 17, 2023

@muttmuure Applied, thank you!

@muttmuure
Copy link
Contributor

Offer sent

@ashimsharma10
Copy link

@dummy-1111
Copy link
Contributor

dummy-1111 commented Jul 18, 2023

@muttmuure

I'm contacting you to know when I would get paid for this issue

cc @mollfpr

@mollfpr
Copy link
Contributor

mollfpr commented Jul 20, 2023

Friendly bump @muttmuure

@muttmuure
Copy link
Contributor

@ashimsharma10 invited

@muttmuure
Copy link
Contributor

@mollfpr paid

@muttmuure
Copy link
Contributor

@s-alves10 paid

@ashimsharma10
Copy link

@muttmuure Accepted invitation. waiting for payment

@muttmuure
Copy link
Contributor

Offer sent

@melvin-bot melvin-bot bot added the Overdue label Jul 23, 2023
@muttmuure
Copy link
Contributor

@ashimsharma10 paid, test rail proposal created.

@melvin-bot melvin-bot bot removed the Overdue label Jul 23, 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