App icon indicating copy to clipboard operation
App copied to clipboard

[$250] Web - Chat - Temporary thread message disappearance when deleting a thread message

Open lanitochka17 opened this issue 1 year ago β€’ 25 comments

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!


Version Number: 9.0.58-1 Reproducible in staging?: Y Reproducible in production?: Y If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: N/A If this was caught during regression testing, add the test name, ID and link from TestRail: N/A Issue reported by: Applause - Internal Team

Action Performed:

  1. Go to https://staging.new.expensify.com/
  2. Open a chat
  3. Send a message in the chat
  4. Click on "Reply in thread" to create a thread message
  5. Delete the threaded message

Expected Result:

A thread message should remain visible and not disappear after deleting it

Actual Result:

When the user deletes a thread message, it disappears for a short while and then reappears

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

Add any screenshot/video evidence

https://github.com/user-attachments/assets/3c526c02-1b86-4831-8557-40220d894b0d

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021856693071374545175
  • Upwork Job ID: 1856693071374545175
  • Last Price Increase: 2024-11-27
  • Automatic offers:
    • mkzie2 | Contributor | 105206412
Issue OwnerCurrent Issue Owner: @thesahindia

lanitochka17 avatar Nov 06 '24 21:11 lanitochka17

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

melvin-bot[bot] avatar Nov 06 '24 21:11 melvin-bot[bot]

Proposal

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

When the user deletes a thread message, it disappears for a short while and then reappears

What is the root cause of that problem?

This arises from https://github.com/Expensify/App/pull/43518, the reportID now contains the reportID of the report where the action belongs to (the ancestor tree is lifted 1 level above).

So when we delete the comment, reportID does not point to the current thread report >> isDeletedParentAction is false because it compares the reportID with childReportID >> Comment is hidden instead of [Deleted message]:

https://github.com/Expensify/App/blob/77b483c50f3669540fa37b530afd87ba709baf3a/src/libs/actions/Report.ts#L1433

https://github.com/Expensify/App/blob/e05545549299f2f0ce6117cbfb62b97fbf15d39a/src/pages/home/report/ReportActionItemFragment.tsx#L108-L110

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

Let's hold this for https://github.com/Expensify/App/pull/51721 where they introduced isThreadFirstChat prop. This will help determining isDeletedParentAction based on whether it is rendered by ReportActionItemParentAction instead of relying on reportID.

mkzie2 avatar Nov 07 '24 01:11 mkzie2

@JmillsExpensify Huh... This is 4 days overdue. Who can take care of this?

melvin-bot[bot] avatar Nov 12 '24 09:11 melvin-bot[bot]

Low priority but we have two proposals outstanding, so I'm going to open this up to the community.

JmillsExpensify avatar Nov 13 '24 13:11 JmillsExpensify

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

melvin-bot[bot] avatar Nov 13 '24 13:11 melvin-bot[bot]

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

melvin-bot[bot] avatar Nov 13 '24 13:11 melvin-bot[bot]

Let's hold this for #51721 where they introduced isThreadFirstChat prop. This will help determining isDeletedParentAction based on whether it is rendered by ReportActionItemParentAction instead of relying on reportID.

Waiting on ^

thesahindia avatar Nov 14 '24 16:11 thesahindia

@JmillsExpensify, @thesahindia Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

melvin-bot[bot] avatar Nov 18 '24 09:11 melvin-bot[bot]

@JmillsExpensify @thesahindia this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

melvin-bot[bot] avatar Nov 20 '24 09:11 melvin-bot[bot]

@JmillsExpensify, @thesahindia Huh... This is 4 days overdue. Who can take care of this?

melvin-bot[bot] avatar Nov 20 '24 09:11 melvin-bot[bot]

πŸ“£ It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? πŸ’Έ

melvin-bot[bot] avatar Nov 20 '24 16:11 melvin-bot[bot]

@JmillsExpensify, @thesahindia 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

melvin-bot[bot] avatar Nov 22 '24 09:11 melvin-bot[bot]

@mkzie2, the PR has been merged.

thesahindia avatar Nov 22 '24 21:11 thesahindia

@JmillsExpensify, @thesahindia Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

melvin-bot[bot] avatar Nov 26 '24 09:11 melvin-bot[bot]

Edited by proposal-police: This proposal was edited at 2024-11-26 10:45:35 UTC.

Updated Proposal

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

When the user deletes a thread message, it disappears for a short while and then reappears

What is the root cause of that problem?

This arises from https://github.com/Expensify/App/pull/43518, the reportID now contains the reportID of the report where the action belongs to (the ancestor tree is lifted 1 level above).

So when we delete the comment, reportID does not point to the current thread report >> isThreadParentMessage is false because it compares the reportID with childReportID >> shouldHideOnDelete is true causing the message to be hidden for a while...:

https://github.com/Expensify/App/blob/cfc41bc42ba95bd6928d4e2456c460f6366e0c43/src/pages/home/report/ReportActionItem.tsx#L1015

... until pendingAction is cleared by the BE:

https://github.com/Expensify/App/blob/be6acac6f051b290d96e14353704065e4928b53a/src/components/OfflineWithFeedback.tsx#L94

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

Thanks to https://github.com/Expensify/App/pull/51721, we don't rely on reportID to check for isThreadParentMessage which is no longer correct. Instead, we use isThreadReportParentAction which is based on whether the action is rendered by ReportActionItemParentAction.

So we need to update:

shouldHideOnDelete={!isThreadReportParentAction}

mkzie2 avatar Nov 26 '24 10:11 mkzie2

@thesahindia Part of the root cause is still correct but I adjusted the solution. Please check again.

mkzie2 avatar Nov 26 '24 10:11 mkzie2

Still working through proposals

JmillsExpensify avatar Nov 26 '24 21:11 JmillsExpensify

πŸ“£ It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? πŸ’Έ

melvin-bot[bot] avatar Nov 27 '24 16:11 melvin-bot[bot]

@mkzie2's proposal looks good to me!

πŸŽ€ πŸ‘€ πŸŽ€ C+ reviewed

thesahindia avatar Nov 27 '24 21:11 thesahindia

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

melvin-bot[bot] avatar Nov 27 '24 21:11 melvin-bot[bot]

@JmillsExpensify @marcochavezf @thesahindia this issue is now 4 weeks old, please consider:

  • Finding a contributor to fix the bug
  • Closing the issue if BZ has been unable to add the issue to a VIP or Wave project
  • If you have any questions, don't hesitate to start a discussion in #expensify-open-source

Thanks!

melvin-bot[bot] avatar Dec 04 '24 09:12 melvin-bot[bot]

Waiting for assignment from @marcochavezf.

mkzie2 avatar Dec 04 '24 16:12 mkzie2

Thanks for the review @thesahindia! Assigning @mkzie2 πŸš€

marcochavezf avatar Dec 05 '24 13:12 marcochavezf

πŸ“£ @mkzie2 πŸŽ‰ 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[bot] avatar Dec 05 '24 13:12 melvin-bot[bot]

@thesahindia The PR is here.

mkzie2 avatar Dec 07 '24 10:12 mkzie2

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

melvin-bot[bot] avatar Dec 12 '24 01:12 melvin-bot[bot]

The solution for this issue has been :rocket: deployed to production :rocket: in version 9.0.74-8 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:

  • https://github.com/Expensify/App/pull/53733

If no regressions arise, payment will be issued on 2024-12-19. :confetti_ball:

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

  • @thesahindia requires payment through NewDot Manual Requests
  • @mkzie2 requires payment automatic offer (Contributor)

melvin-bot[bot] avatar Dec 12 '24 01:12 melvin-bot[bot]

@thesahindia @JmillsExpensify @thesahindia 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]

melvin-bot[bot] avatar Dec 12 '24 01:12 melvin-bot[bot]

Payment summary:

  • Contributor: $250 for @mkzie2 via Upwork
  • Reviewer: $250 for @thesahindia via New Expensify

JmillsExpensify avatar Dec 20 '24 20:12 JmillsExpensify

Contributor has been paid out.

JmillsExpensify avatar Dec 20 '24 20:12 JmillsExpensify