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

[Awaiting Checklist Completion] [$1000] Web - The reveal /hide button text is cut off in offline mode and doesn't disappears dynamically #20946

Closed
2 of 6 tasks
kbecciv opened this issue Jun 16, 2023 · 61 comments
Assignees
Labels
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 16, 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. Go to staging dot on web chrome and login with User A (On another window login with User B)
  2. From User A, send a message to User B and from User B mark the same message as assault
  3. On User A, go offline and delete the message you sent earlier and notice that the button text is cut from the between. (Cutting the button text makes it look weird since we don't normally see any button texts that are cut from between)
  4. You can see still the button reveal/hide is present. But now click on any other chat and return back to the previous chat and notice that the button disappears. Thus, the button should have dynamically disappeared when the user A deleted the message earlier.

Expected Result:

The reveal /hide button text should not be cut off in the first place. Also, the button should have disappeared dynamically when the user has deleted the message in offline mode.

Actual Result:

The reveal /hide button text is cut off and doesn't disappear dynamically

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

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

error-2023-06-10_21.31.18.1.mp4
Recording.737.mp4

Expensify/Expensify Issue URL:

Issue reported by: @priya-zha

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

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~014c79e15242357a09
  • Upwork Job ID: 1670827258725896192
  • Last Price Increase: 2023-07-03
@kbecciv kbecciv added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Jun 16, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 16, 2023

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

@melvin-bot
Copy link

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

@dukenv0307
Copy link
Contributor

dukenv0307 commented Jun 16, 2023

Proposal

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

The reveal button appears after deleting message in offline mode, but it is hidden after open an other report and go back

What is the root cause of that problem?

When deleting a comment, we update optimistic data of report action and remove all moderationDecisions of the message

function deleteReportComment(reportID, reportAction) {
const reportActionID = reportAction.reportActionID;
const deletedMessage = [
{
type: 'COMMENT',
html: '',
text: '',
isEdited: true,
isDeletedParentAction: true,
},
];
const optimisticReportActions = {

After optimistic data is merged in Onyx, useEffect is triggered in ReportActionItem, and then because moderationDecision is empty after deleting, useEffect returns here, and moderationDecision state is still last decision of message. That is the reason, reveal message button still display after deleting comment in offline
if (!props.action.actionName === CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT || _.isEmpty(props.action.message[0].moderationDecisions)) {
return;
}

After we open other chat and go back, moderationDecision has default value CONST.MODERATION.MODERATOR_DECISION_APPROVED, useEffect doesn't update this state because now props.action.message[0].moderationDecisions is empty.
const [moderationDecision, setModerationDecision] = useState(CONST.MODERATION.MODERATOR_DECISION_APPROVED);

That makes hasBeenFlagged is false with moderationDecision is CONST.MODERATION.MODERATOR_DECISION_APPROVED and then reveal message button is hidden
const hasBeenFlagged = !_.contains([CONST.MODERATION.MODERATOR_DECISION_APPROVED, CONST.MODERATION.MODERATOR_DECISION_PENDING], moderationDecision);

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

  • If delete message in offline mode still need to show reveal button, we should keep moderationDecisions of message in optimisticReportActions in deleteReportComment function by updating like this
const deletedMessage = [
        {
            type: 'COMMENT',
            html: '',
            text: '',
            isEdited: true,
            isDeletedParentAction: true,
            moderationDecisions: reportAction.message[0].moderationDecisions
        },
    ];
  • If not, we could update useEffect to reset moderationDecision state to CONST.MODERATION.MODERATOR_DECISION_APPROVED if action is addComment and props.action.message[0].moderationDecisions is empty

What alternative solutions did you explore? (Optional)

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

Okay, I agree. @dangrous - do you agree? This is pretty edge case but that's what open source bug reporting is for.

The reveal /hide button text should not be cut off in the first place. Also, the button should have disappeared dynamically when the user has deleted the message in offline mode.

@melvin-bot melvin-bot bot removed the Overdue label Jun 19, 2023
@twisterdotcom twisterdotcom 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 - The reveal /hide button text is cut off in offline mode and doesn't disappears dynamically [$1000] Web - The reveal /hide button text is cut off in offline mode and doesn't disappears dynamically Jun 19, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 19, 2023

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

@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 @twisterdotcom 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 - @rushatgabhane (External)

@dangrous
Copy link
Contributor

So I think this is sorta two bugs, if I'm understanding correctly.

  1. The button text is also given a strike through format when the comment is deleted. (Is that what you meant by "cut off" @kbecciv?). This is a bug and should be fixed, but I don't think is addressed in the existing proposal.
  2. The button disappears when navigating away from a deleted message, while often. This is ALSO a bug, and @dukenv0307's proposal seems likely to fix it.

@dukenv0307
Copy link
Contributor

dukenv0307 commented Jun 20, 2023

@dangrous So the expected result is reveal button should always appear and not give a strike through when deleting in offline mode, right?

@dangrous
Copy link
Contributor

yep I think that's it!

@rushatgabhane
Copy link
Member

rushatgabhane commented Jun 21, 2023

The reveal /hide button text is cut off in offline mode and doesn't disappears dynamically

@dukenv0307 could you please help me understand the problem? I don't really understand it from the description in your proposal 😅

Please update your proposal with a more detailed description of the problem

@dukenv0307
Copy link
Contributor

dukenv0307 commented Jun 21, 2023

The reveal button still appears after deleting message in offline mode, but it is hidden after open an other report and go back

@rushatgabhane Do you think the quote here is enough detail?

@rushatgabhane
Copy link
Member

rushatgabhane commented Jun 21, 2023

If delete message in offline mode still need to show reveal button, we should keep moderationDecisions of message in optimisticReportActions in deleteReportComment function by updating like this

@dukenv0307 is this a good idea? Optimistic data is what gets stored in the database after the user is back online.
I'm assuming that the message is hard deleted from the database, but the proposal would save a moderation comment for it.

@dukenv0307
Copy link
Contributor

@rushatgabhane That is the way we can keep showing reveal button when deleting in offline. When we go back to online the message will be hidden and no problem if we store moderation.

@dukenv0307
Copy link
Contributor

My solution mentioned two behaviors for this issue. I think we need to clarify which case is expected behavior.

@twisterdotcom
Copy link
Contributor

the expected result is reveal button should always appear and not give a strike through when deleting in offline mode

This is the expected result.

@ShogunFire
Copy link
Contributor

ShogunFire commented Jun 24, 2023

Proposal

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

We are showing the button hide/reveal when we are deleting a flagged comment offline

What is the root cause of that problem?

When a message has been deleted, in useEffect here:

if (!props.action.actionName === CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT || _.isEmpty(props.action.message[0].moderationDecisions)) {
return;
}

We return without updating the variable moderationDecision and the variable isHidden so the deletedComment still act like a flagged comment until we refresh the page

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

In the useEffect we can replace this

if (!props.action.actionName === CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT || _.isEmpty(props.action.message[0].moderationDecisions)) {
    return;
}

By this:

if (!props.action.actionName === CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT) {
    return;
}

if (_.isEmpty(props.action.message[0].moderationDecisions)){
    setModerationDecision(CONST.MODERATION.MODERATOR_DECISION_APPROVED);
    setIsHidden(false);
    return;
}

Result:

2023-06-27.12-02-28.mp4

What alternative solutions did you explore? (Optional)

@melvin-bot melvin-bot bot added the Overdue label Jun 24, 2023
@twisterdotcom
Copy link
Contributor

Always goes overdue on the weekend. @rushatgabhane will review soon.

@melvin-bot melvin-bot bot removed the Overdue label Jun 26, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jun 26, 2023

📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸

@melvin-bot
Copy link

melvin-bot bot commented Jul 5, 2023

📣 @dukenv0307 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Upwork job
Please accept the offer 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 📖

@melvin-bot
Copy link

melvin-bot bot commented Jul 5, 2023

📣 @Priya! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:

  1. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
  2. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
  3. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
    Screen Shot 2022-11-16 at 4 42 54 PM
    Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

@melvin-bot
Copy link

melvin-bot bot commented Jul 5, 2023

The BZ member will need to manually hire priya for the Reporter role. Please store your Upwork details and apply to our Upwork job so this process is automatic in the future!

@melvin-bot melvin-bot bot added the Reviewing Has a PR in review label Jul 5, 2023
@dukenv0307
Copy link
Contributor

@rushatgabhane The PR is ready to review.

@melvin-bot
Copy link

melvin-bot bot commented Jul 12, 2023

@twisterdotcom, @MariaHCD, @rushatgabhane, @dukenv0307 Whoops! This issue is 2 days overdue. Let's get this updated quick!

@MariaHCD
Copy link
Contributor

@rushatgabhane is reviewing the PR.

@melvin-bot
Copy link

melvin-bot bot commented Jul 20, 2023

@twisterdotcom, @MariaHCD, @rushatgabhane, @dukenv0307 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@MariaHCD
Copy link
Contributor

PR was merged today.

@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 25, 2023
@melvin-bot melvin-bot bot changed the title [$1000] Web - The reveal /hide button text is cut off in offline mode and doesn't disappears dynamically [HOLD for payment 2023-08-01] [$1000] Web - The reveal /hide button text is cut off in offline mode and doesn't disappears dynamically Jul 25, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jul 25, 2023
@melvin-bot
Copy link

melvin-bot bot commented Jul 25, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Jul 25, 2023

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

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

  • [@rushatgabhane] The PR that introduced the bug has been identified. Link to the PR:
  • [@rushatgabhane] 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:
  • [@rushatgabhane] 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:
  • [@rushatgabhane] Determine if we should create a regression test for this bug.
  • [@rushatgabhane] 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.
  • [@twisterdotcom] 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 Overdue and removed Weekly KSv2 labels Jul 31, 2023
@twisterdotcom
Copy link
Contributor

twisterdotcom commented Aug 1, 2023

Payment summary:

@melvin-bot melvin-bot bot removed the Overdue label Aug 1, 2023
@twisterdotcom twisterdotcom removed the Awaiting Payment Auto-added when associated PR is deployed to production label Aug 1, 2023
@twisterdotcom twisterdotcom changed the title [HOLD for payment 2023-08-01] [$1000] Web - The reveal /hide button text is cut off in offline mode and doesn't disappears dynamically [Awaiting Checklist Completion] [$1000] Web - The reveal /hide button text is cut off in offline mode and doesn't disappears dynamically Aug 1, 2023
@rushatgabhane
Copy link
Member

made a manual request - https://staging.new.expensify.com/r/4074322401487931

@rushatgabhane
Copy link
Member

rushatgabhane commented Aug 2, 2023

  1. The PR that introduced the bug has been identified. Link to the PR: [No QA] Handle Moderated Messages in UI #19476

  2. 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#r1282149644

  3. 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 because it's part of checklist to test PR in offline mode

  4. Determine if we should create a regression test for this bug. No

  5. 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 - N.A.

@JmillsExpensify
Copy link

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

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

No branches or pull requests

9 participants