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-01-17] [$500] Thread - You can create a thread for a deleted message in offline mode #32236

Closed
6 tasks done
lanitochka17 opened this issue Nov 29, 2023 · 33 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

@lanitochka17
Copy link

lanitochka17 commented Nov 29, 2023

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: 1.4.5-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
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:

Action Performed:

  1. Open New Expensify app
  2. Navigate to any conversation
  3. Send a message to the conversation
  4. Disable the internet connection
  5. Click on the Trash icon to delete the message
  6. Click on the Thread icon on the deleted message
  7. In the deleted message thread, send several messages
  8. Turn on the Internet and return to the conversation

Expected Result:

The function of creating a Thread should be disabled for messages deleted offline

Actual Result:

You can create a thread for a deleted message in offline mode

Workaround:

Unknown

Platforms:

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

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Bug6295222_1701296353332.Recording__786.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~010998768658278f28
  • Upwork Job ID: 1729992047400849408
  • Last Price Increase: 2023-12-13
  • Automatic offers:
    • dukenv0307 | Contributor | 28057913
Issue OwnerCurrent Issue Owner: @eVoloshchak
@lanitochka17 lanitochka17 added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Nov 29, 2023
@melvin-bot melvin-bot bot changed the title Thread - You can create a thread for a deleted message in offline mode [$500] Thread - You can create a thread for a deleted message in offline mode Nov 29, 2023
Copy link

melvin-bot bot commented Nov 29, 2023

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

Copy link

melvin-bot bot commented Nov 29, 2023

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

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

melvin-bot bot commented Nov 29, 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

Copy link

melvin-bot bot commented Nov 29, 2023

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

@ZhenjaHorbach
Copy link
Contributor

Proposal

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

Thread - You can create a thread for a deleted message in offline mode

What is the root cause of that problem?

We do not have the conditions for this requirement

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

As for me
The best way to fix this
Prevent the user from opening threads
So we can hide the buttons

We can add new condition

            if (!ReportUtils.canDeleteReportAction(reportAction, reportID) && isOffline) {
                return false;
            }

shouldShow: (type, reportAction, isArchivedRoom, betas, anchor, isChronosReport, reportID) => {
if (type !== CONTEXT_MENU_TYPES.REPORT_ACTION) {
return false;
}
const isCommentAction = reportAction.actionName === CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT;
const isReportPreviewAction = reportAction.actionName === CONST.REPORT.ACTIONS.TYPE.REPORTPREVIEW;
const isIOUAction = reportAction.actionName === CONST.REPORT.ACTIONS.TYPE.IOU && !ReportActionsUtils.isSplitBillAction(reportAction);
const isModifiedExpenseAction = ReportActionsUtils.isModifiedExpenseAction(reportAction);
const isTaskAction = ReportActionsUtils.isTaskAction(reportAction);
return (isCommentAction || isReportPreviewAction || isIOUAction || isModifiedExpenseAction || isTaskAction) && !ReportUtils.isThreadFirstChat(reportAction, reportID);
},

Also we can make the same for subscribeToThread

What alternative solutions did you explore? (Optional)

NA

@abzokhattab
Copy link
Contributor

abzokhattab commented Nov 29, 2023

Proposal

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

User can a thread for a deleted message in offline mode

What is the root cause of that problem?

we dont disable reply in thread for deleted messages

{
isAnonymousAction: false,
textTranslateKey: 'reportActionContextMenu.replyInThread',
icon: Expensicons.ChatBubble,
successTextTranslateKey: '',
successIcon: null,
shouldShow: (type, reportAction, isArchivedRoom, betas, anchor, isChronosReport, reportID) => {
if (type !== CONTEXT_MENU_TYPES.REPORT_ACTION) {
return false;
}
const isCommentAction = reportAction.actionName === CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT;
const isReportPreviewAction = reportAction.actionName === CONST.REPORT.ACTIONS.TYPE.REPORTPREVIEW;
const isIOUAction = reportAction.actionName === CONST.REPORT.ACTIONS.TYPE.IOU && !ReportActionsUtils.isSplitBillAction(reportAction);
const isModifiedExpenseAction = ReportActionsUtils.isModifiedExpenseAction(reportAction);
const isTaskAction = ReportActionsUtils.isTaskAction(reportAction);
return (isCommentAction || isReportPreviewAction || isIOUAction || isModifiedExpenseAction || isTaskAction) && !ReportUtils.isThreadFirstChat(reportAction, reportID);
},

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

we need to add

   const isCommentDeleted = ReportActionsUtils.isDeletedAction(reportAction);
            return (
                (isCommentAction || isReportPreviewAction || isIOUAction || isModifiedExpenseAction || isTaskAction) &&
                !ReportUtils.isThreadFirstChat(reportAction, reportID) &&
                !isCommentDeleted
            );

@dukenv0307
Copy link
Contributor

dukenv0307 commented Nov 30, 2023

Proposal

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

You can create a thread for a deleted message in offline mode

What is the root cause of that problem?

In here, we don't hide "Reply in thread" for deleted message that doesn't have an existing thread.

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

In here, hide "Reply in thread" for deleted message (check using isDeletedAction) that doesn't have an existing thread (check similar to this). If the deleted message has an existing thread, we should still allow seeing and replying to the thread.

&& (!isCommentDeleted || shouldDisplayThreadReplies)

We can do the same for "Subscribe/unsubscribe to thread"

What alternative solutions did you explore? (Optional)

NA

@yh-0218
Copy link
Contributor

yh-0218 commented Nov 30, 2023

Proposal

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

You can create a thread for a deleted message in offline mode

What is the root cause of that problem?

We didn't consider pendingAction

shouldShow: (type, reportAction, isArchivedRoom, betas, anchor, isChronosReport, reportID) => {

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

we can update like this.

      if (type !== CONTEXT_MENU_TYPES.REPORT_ACTION || reportAction.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE) {
                return false;
       }

if (type !== CONTEXT_MENU_TYPES.REPORT_ACTION) {
return false;
}

What alternative solutions did you explore? (Optional)

@melvin-bot melvin-bot bot added the Overdue label Dec 2, 2023
Copy link

melvin-bot bot commented Dec 4, 2023

@eVoloshchak, @bfitzexpensify Eep! 4 days overdue now. Issues have feelings too...

@bfitzexpensify
Copy link
Contributor

Proposals ready for review @eVoloshchak

@melvin-bot melvin-bot bot removed the Overdue label Dec 5, 2023
Copy link

melvin-bot bot commented Dec 6, 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 melvin-bot bot added the Overdue label Dec 8, 2023
@bfitzexpensify
Copy link
Contributor

Bump on review @eVoloshchak - thank you!

@melvin-bot melvin-bot bot added Overdue and removed Overdue labels Dec 8, 2023
@bfitzexpensify
Copy link
Contributor

Another bump here, thanks @eVoloshchak

Copy link

melvin-bot bot commented Dec 12, 2023

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

Copy link

melvin-bot bot commented Dec 13, 2023

@eVoloshchak @bfitzexpensify 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!

Copy link

melvin-bot bot commented Dec 13, 2023

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

@eVoloshchak
Copy link
Contributor

@ZhenjaHorbach's proposal: this wouldn't work, since the button would be disabled for all the messages while offline, regardless of whether it was deleted or not

@abzokhattab's proposal uses the correct approach, but as @dukenv0307 has pointed out, we shouldn't hide "Reply in thread" option if there is already an existing thread. There isn't much value in replying to a thread you've just deleted, but there is value in viewing the thread

@dukenv0307's proposal looks good to me, addresses the issue above, I think we should proceed with this implementation

🎀👀🎀 C+ reviewed!

@melvin-bot melvin-bot bot removed the Overdue label Dec 13, 2023
@dukenv0307
Copy link
Contributor

@eVoloshchak The PR is ready for review.

@Julesssss
Copy link
Contributor

Bumping @eVoloshchak for review

@melvin-bot melvin-bot bot added Monthly KSv2 and removed Weekly KSv2 labels Jan 8, 2024
Copy link

melvin-bot bot commented Jan 8, 2024

This issue has not been updated in over 15 days. @eVoloshchak, @Julesssss, @bfitzexpensify, @dukenv0307 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 Jan 10, 2024
@melvin-bot melvin-bot bot changed the title [$500] Thread - You can create a thread for a deleted message in offline mode [HOLD for payment 2024-01-17] [$500] Thread - You can create a thread for a deleted message in offline mode Jan 10, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Jan 10, 2024
Copy link

melvin-bot bot commented Jan 10, 2024

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

Copy link

melvin-bot bot commented Jan 10, 2024

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

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

Copy link

melvin-bot bot commented Jan 10, 2024

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:

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

@bfitzexpensify
Copy link
Contributor

I'm going to be mostly ooo until Jan 29, assigning a second BZ team member to keep an eye on this.

  • ready for payment on 01/17
  • BZ checklist needs completing (bump on that @eVoloshchak)

@bfitzexpensify bfitzexpensify added Bug Something is broken. Auto assigns a BugZero manager. and removed Bug Something is broken. Auto assigns a BugZero manager. labels Jan 11, 2024
Copy link

melvin-bot bot commented Jan 11, 2024

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

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Jan 11, 2024
Copy link

melvin-bot bot commented Jan 15, 2024

@eVoloshchak, @Julesssss, @trjExpensify, @bfitzexpensify, @dukenv0307 Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@melvin-bot melvin-bot bot added the Overdue label Jan 15, 2024
@trjExpensify
Copy link
Contributor

Kewl! Still awaiting the checklist, @eVoloshchak!

@melvin-bot melvin-bot bot added Daily KSv2 and removed Daily KSv2 Overdue labels Jan 16, 2024
@eVoloshchak
Copy link
Contributor

  • The PR that introduced the bug has been identified. Link to the PR: there isn't a PR that has caused this, it's the initial implementation
  • 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: N/A
  • 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 don't think an additional discussion is needed, this isn't a "bug", but rather a feature/follow-up to the existing logic

Regression Test Proposal

  1. Open a report
  2. Send a message
  3. Turn off the internet
  4. Delete the message you've just sent
  5. Hover over or long press on the message to open the context menu
  6. Verify that the thread options (Reply in thread, subscribe/unsubscribe thread) don't appear

Do we agree 👍 or 👎

@bfitzexpensify
Copy link
Contributor

Online today for a bit so I can take care of this.

Payment summary:

  • $500 to @dukenv0307 as the contributor - paid via Upwork ✅
  • $500 to @eVoloshchak as the C+ to be paid via manual request

Opened https://github.com/Expensify/Expensify/issues/361939 to add the regression test steps.

We're all done here - thanks everyone!

@JmillsExpensify
Copy link

$500 approved for @eVoloshchak based on comment above.

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

10 participants