Skip to content

[HOLD for payment 2023-10-10] [$1000] Web - Chat - Deleted message can be undo when in editing mode #24445

Closed

Description

@izarutskaya

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 any chat and send a message A
  2. Reply that message in a new thread
  3. In the thread, edit that message but do not save it
  4. Back to the main chat, delete that message
  5. Go to the thread again, note that the message still in editing mode, and if we save that message, we can undo the delete action

Expected Result:

The message should be deleted even in editing mode ( This is how chat in slack works )

Actual Result:

The message is not deleted and can be undo

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.53-1

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

Draft-Editing.mp4
Recording.1176.mp4

Expensify/Expensify Issue URL:

Issue reported by: @RickyMasha

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

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01ad60e1290e36e223
  • Upwork Job ID: 1690997103080361984
  • Last Price Increase: 2023-08-14
  • Automatic offers:
    • fedirjh | Reviewer | 26238747
    • namhihi237 | Contributor | 26238751

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Aug 11, 2023
  2. namhihi237 commented on Aug 11, 2023

    @namhihi237
    Contributor

    Proposal

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

    The message should be deleted even in editing mode

    What is the root cause of that problem?

    Conditions to show edit message here

    We have 2 delete cases while drafting the message:
    Case 1: Delete the first message in a thread while the parent report is drafted edit
    Case 2: Delete the message while drafting edit in the thread

    In both cases, we have not clear draftMessage when deleting the message
    In addition, we also have the case of using 2 devices and deleting the message on 1 device, we also need to delete the draft message in this case.

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

    We should clear draftMessage when deleting the message in successData here:

         {
                onyxMethod: Onyx.METHOD.MERGE,
                key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS_DRAFTS}${reportAction.childReportID}_${reportAction.reportActionID}`,
                value: null
            },
    
    
        const report = ReportUtils.getReport(reportID);
    
            {
                onyxMethod: Onyx.METHOD.MERGE,
                key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS_DRAFTS}${report.parentReportID}_${reportAction.reportActionID}`,
                value: null
            }
    

    In the case we use 2 devices, we should check whether the message was deleted or not and clear the draft message of reportAction in here .

            if (ReportActionsUtils.isDeletedAction(props.action) && props.action.pendingAction !== 'delete') {
                Report.saveReportActionDraft(props.action.childReportID, props.action.reportActionID, '');
                Report.saveReportActionDraft(props.report.reportID, props.action.reportActionID, '');
            }
    

    Result:
    Case use on 2 devices online
    https://github.com/Expensify/App/assets/39086067/0432925f-659c-4d0a-8739-7c5460f74c17

    Case 2 devices but 1 device offline after going online

    Screen.Recording.2023-08-16.at.00.16.48.mov

    Case 1 device and offline:

    Screen.Recording.2023-08-16.at.00.27.48.mov

    What alternative solutions did you explore? (Optional)

    N/A

  3. melvin-bot commented on Aug 11, 2023

    @melvin-bot

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

  4. melvin-bot commented on Aug 11, 2023

    @melvin-bot

    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
  5. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Aug 14, 2023
  6. changed the title [-]Web - Chat - Deleted message can be undo when in editing mode[/-] [+][$1000] Web - Chat - Deleted message can be undo when in editing mode[/+] on Aug 14, 2023
  7. melvin-bot commented on Aug 14, 2023

    @melvin-bot
  8. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Aug 14, 2023
  9. melvin-bot commented on Aug 14, 2023

    @melvin-bot

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

  10. melvin-bot commented on Aug 14, 2023

    @melvin-bot

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

  11. kadiealexander commented on Aug 14, 2023

    @kadiealexander
    Contributor

    Not overdue!

  12. 46 remaining items

  13. kadiealexander commented on Oct 13, 2023

    @kadiealexander
    Contributor

    Payouts due:

    Eligible for 50% #urgency bonus? No

    Upwork job is here.

  14. kadiealexander commented on Oct 13, 2023

    @kadiealexander
    Contributor

    @RickyMasha please apply here - https://www.upwork.com/jobs/~014a63052d4722b668

    @fedirjh please complete the checklist and accept the contract I sent over

    @namhihi237 please accept the contract I sent over

  15. namhihi237 commented on Oct 13, 2023

    @namhihi237
    Contributor

    @kadiealexander aceepted ,thanks

  16. fedirjh commented on Oct 13, 2023

    @fedirjh
    Contributor

    BugZero Checklist:

    • Link to the PR: This is not a regression, We have not synchronized the editing of the parent message and the top message within the thread from the initial implementation of the thread.
    • Determine if we should create a regression test for this bug: 🟢

    Regression Test Proposal

    1. Open the same account on two devices.
    2. On both devices, open the same report.
    3. On device 1, send a message.
    4. On device 2, reply to the message in a new thread.
    5. Within the thread, edit the message but do not save it.
    6. On device 1 deletes that message.
    7. On device 2, verify that the edited message exit the editing mode and displays [delete message]
    • Do we agree 👍 or 👎
  17. RickyMasha commented on Oct 13, 2023

    @RickyMasha

    @kadiealexander Sorry for the inconvenience, but all i have to do is clicking the apply now button or I have to do anything else as a reporter
    Thanks for your patience

  18. kadiealexander commented on Oct 16, 2023

    @kadiealexander
    Contributor

    Just clicking "apply now" is fine :)

  19. RickyMasha commented on Oct 16, 2023

    @RickyMasha

    @kadiealexander Thanks, applied

  20. kadiealexander commented on Oct 17, 2023

    @kadiealexander
    Contributor

    @RickyMasha I haven't received your proposal in Upwork, please take a look and apply again here https://www.upwork.com/jobs/~014a63052d4722b668

  21. RickyMasha commented on Oct 17, 2023

    @RickyMasha

    @kadiealexander I just submitted the proposal for reporting this bug. Thank for your time

  22. kadiealexander commented on Oct 19, 2023

    @kadiealexander
    Contributor

    @RickyMasha Sent you an offer :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions