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-10-02] [$500] Chat - Flag as offensive page does not disappear when deleting the Message #27032

Closed
1 of 6 tasks
izarutskaya opened this issue Sep 8, 2023 · 32 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

@izarutskaya
Copy link

izarutskaya commented Sep 8, 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. From User A Send a message to User B.
  2. From User B, Go to reply in thread on the message sent from User A. > Then Click on Flag as Offensive button from the reaction menu.
  3. Now Delete the message from User A while the Flag as offensive page is still open from User B.

Expected Result:

The opened Flag as offensive page from User B. should be closed when User A deletes the message. It should show the Page Not Found error message.

Actual Result:

The Flag as offensive page remains open.

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: v1.3.66-3

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

T123-Flagas.mp4
Recording.1487.mp4

Expensify/Expensify Issue URL:

Issue reported by: @daveSeife

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

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01f9ee295f5f5cd370
  • Upwork Job ID: 1702099690396909568
  • Last Price Increase: 2023-09-13
  • Automatic offers:
    • 0xmiroslav | Reviewer | 26722920
    • tienifr | Contributor | 26722922
    • daveSeife | Reporter | 26722924
@izarutskaya izarutskaya added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Sep 8, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 8, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 8, 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

@tienifr
Copy link
Contributor

tienifr commented Sep 8, 2023

Proposal

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

Flag comment page does not dismiss when comment is deleted.

What is the root cause of that problem?

ATM, FlagCommentPage only subscribes to reportActions of the current report in Onyx. However, in this case, it's a child report, thus any changes to the actual (parent) report action does not propagate to the page.

export default compose(withLocalize, withReportAndReportActionOrNotFound)(FlagCommentPage);

I don't think we should dismiss the RHP but show Not found page on deletion instead. That's consistent with normal comments.

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

Subscribe FlagCommentPage to parent report actions:

 withOnyx({
    parentReportActions: {
        key: ({report}) => `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${report.parentReportID || report.reportID}`,
        canEvict: false,
    },
})

Thus on deletion, RHP would show Not found page.

There's no way to determine whether this is a child report thus I use report.reportID as the fallback id.

What alternative solutions did you explore? (Optional)

In case we want to not show anything, just keep the page open, remove props.report and props.reportActions from the dependencies of getActionToFlag, so it won't get called again for any changes:

}, [props.report, props.reportActions, props.route.params.reportActionID]);

@jliexpensify
Copy link
Contributor

I can repro this, but I am not convinced this is a bug - it seems like it's a delay. I'm asking the Engineer who implemented the Flag as offensive button for a second opinion!

@jliexpensify jliexpensify changed the title Chat - Flag as offensive page does not dissapear when deleteing the Message [WAITING ON DGR] Chat - Flag as offensive page does not dissapear when deleteing the Message Sep 10, 2023
@tienifr
Copy link
Contributor

tienifr commented Sep 10, 2023

Normally for a report action, the flag page shows Not found on message deletion. But thread comment is not. I think we should fix this for consistency.

flag-compressed.mov

@jliexpensify
Copy link
Contributor

@tienifr @daveSeife - I just spoke to Daniel, who implemented the Mark as offensive feature, and confirmed that this behaviour is intentional (comment here)

We chose not to fix it in #20674, so the same goes here.

@tienifr
Copy link
Contributor

tienifr commented Sep 12, 2023

if the flag page is already open when the message gets deleted, then keep it open and do nothing when an option is chosen

@jliexpensify Seems like something has changed, when I deleted the attachment, the flag comment page would show Not found:

flag-comment-compressed.mov

It's the same for all other comments:

flag-compressed.mov

Only thread first comment is not. As explained in my proposal, we should show not found page for thread comments on deletion as well to maintain consistency (not close it as in the issue description).

In case we want to not show anything, just keep the page open, I've provided a solution for that in the alternative solution part.

cc: @dangrous

@jliexpensify jliexpensify changed the title [WAITING ON DGR] Chat - Flag as offensive page does not dissapear when deleteing the Message Chat - Flag as offensive page does not dissapear when deleteing the Message Sep 13, 2023
@jliexpensify jliexpensify changed the title Chat - Flag as offensive page does not dissapear when deleteing the Message Chat - Flag as offensive page does not disappear when deleting the Message Sep 13, 2023
@jliexpensify jliexpensify reopened this Sep 13, 2023
@jliexpensify
Copy link
Contributor

Spoke to Daniel again, we'll fix this for consistency's sake.

@jliexpensify jliexpensify added the External Added to denote the issue can be worked on by a contributor label Sep 13, 2023
@melvin-bot melvin-bot bot changed the title Chat - Flag as offensive page does not disappear when deleting the Message [$500] Chat - Flag as offensive page does not disappear when deleting the Message Sep 13, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 13, 2023

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

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

melvin-bot bot commented Sep 13, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 13, 2023

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

@tienifr
Copy link
Contributor

tienifr commented Sep 14, 2023

@jliexpensify Just want to confirm the expected behavior here. Do we want to leave the flag page as is; or show not found page on deletion?

@jliexpensify
Copy link
Contributor

@dangrous - my assumption is that we'd want to be consistent across the board, so we'll show page not found upon deletion of the offensive comment. Can I confirm this is what you're thinking too? Thanks!

@dangrous
Copy link
Contributor

yep! show not found

@0xmiros
Copy link
Contributor

0xmiros commented Sep 16, 2023

@tienifr's proposal (main solution) looks good to me.
🎀 👀 🎀 C+ reviewed

@melvin-bot
Copy link

melvin-bot bot commented Sep 16, 2023

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

@srikarparsi
Copy link
Contributor

Looks good to me as well, assigning you to the issue @tienifr

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Sep 18, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 18, 2023

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

Offer link
Upwork job

@melvin-bot
Copy link

melvin-bot bot commented Sep 18, 2023

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

Offer link
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 Sep 18, 2023

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

Offer link
Upwork job

@tienifr
Copy link
Contributor

tienifr commented Sep 18, 2023

PR ready for review: #27656.

@melvin-bot
Copy link

melvin-bot bot commented Sep 21, 2023

Based on my calculations, the pull request did not get merged within 3 working days of assignment. Please, check out my computations here:

  • when @tienifr got assigned: 2023-09-18 00:55:59 Z
  • when the PR got merged: 2023-09-21 03:06:08 UTC
  • days elapsed: 3

On to the next one 🚀

@0xmiros
Copy link
Contributor

0xmiros commented Sep 21, 2023

Hope this would be eligible for efficiency bonus as C+ approved PR in 2 days 15 hrs and there were no changes requested.
cc: @srikarparsi

@jliexpensify
Copy link
Contributor

It should, I'd imagine!

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Sep 25, 2023
@melvin-bot melvin-bot bot changed the title [$500] Chat - Flag as offensive page does not disappear when deleting the Message [HOLD for payment 2023-10-02] [$500] Chat - Flag as offensive page does not disappear when deleting the Message Sep 25, 2023
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Sep 25, 2023
@melvin-bot
Copy link

melvin-bot bot commented Sep 25, 2023

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

@melvin-bot
Copy link

melvin-bot bot commented Sep 25, 2023

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.73-1 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-10-02. 🎊

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 Sep 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:

  • [@0xmiroslav] The PR that introduced the bug has been identified. Link to the PR:
  • [@0xmiroslav] 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:
  • [@0xmiroslav] 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:
  • [@0xmiroslav] Determine if we should create a regression test for this bug.
  • [@0xmiroslav] 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.
  • [@jliexpensify] 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 Oct 1, 2023
@jliexpensify
Copy link
Contributor

Sorry, missed this! @0xmiroslav can you complete the checklist please?

@melvin-bot melvin-bot bot removed the Overdue label Oct 4, 2023
@jliexpensify
Copy link
Contributor

Payment Summary:

  • Bug Reporter: @daveSeife $50
  • Contributor: @tienifr $500 + $250
  • C+: @0xmiroslav $500 + $250

Upwork job

@0xmiros
Copy link
Contributor

0xmiros commented Oct 4, 2023

This is kind of "dynamic update" issue and the bug always existed after flag implementation.
As this is unusual case, I propose no regression test.

@jliexpensify
Copy link
Contributor

All paid except for @0xmiroslav . Did you want me to close this?

@0xmiros
Copy link
Contributor

0xmiros commented Oct 4, 2023

yes please

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

6 participants