Skip to content

[HOLD for payment 2023-08-28] [$1000] When deleting a file, there is a space between the username and the '[Deleted message]' #24216

Closed

Description

@kavimuru

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. Open a chat.
  2. Send an attachment.
  3. Click on 'Reply in thread.'
  4. Delete the thread file.
  5. Notice the space between username and delete message
  6. Now check that after deleting a text message

Expected Result:

When deleting a file or text message, there should be consistent spacing between the username and the '[Deleted message]'

Actual Result:

When deleting a file, there is a space between the username and the '[Deleted message]' message, causing an inconsistency in spacing compared to deleting a text message.

Workaround:

Can the user still use Expensify without this being fixed? Have you informed them of the workaround?

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.50-0
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

screen-recording-2023-08-01-at-33634-pm_OkJMrkI5.1.mp4
Recording.5751.mp4

Expensify/Expensify Issue URL:
Issue reported by: @ayazhussain79
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1690887871347529

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~019a73e78df922007d
  • Upwork Job ID: 1688865815884058624
  • Last Price Increase: 2023-08-08
  • Automatic offers:
    • cubuspl42 | Reviewer | 26111804
    • bernhardoj | Contributor | 26111806

Activity

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

    @namhihi237
    Contributor

    Proposal

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

    When deleting a file or text message, there should be consistent spacing between the username and the '[Deleted message]'

    What is the root cause of that problem?

    Here is the difference between space after deleting text message and attachment
    If it's an attachment, we pass styles.mt2 here

    !props.displayAsGroup && isAttachment ? styles.mt2 : undefined,

    We have 2 cases:

    • Online => delete => show [Delete message]
    • Offline => delete => keep it intact => online => show [Deleted message]

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

    Here we should check more if the attachment has been deleted or not

    network: networkPropTypes.isRequired,
     const pendingAction = lodashGet(props.action, 'pendingAction', '');
    !props.displayAsGroup &&
        isAttachment &&
        (!ReportActionsUtils.isDeletedAction(props.action) ||
            (props.network.isOffline && ReportActionsUtils.isDeletedAction(props.action) && pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE)) ?
        styles.mt2 :
        undefined,
    memo(
        ReportActionItem,
        (prevProps, nextProps) =>
        //...
        prevProps.network.isOffline === nextProps.network.isOffline,
    ),

    Result:

    • Online
    Screen.Recording.2023-08-08.at.00.36.26.mov
    • Offline
    Screen.Recording.2023-08-08.at.00.38.29.mov

    What alternative solutions did you explore? (Optional)

    N/A

  3. DanutGavrus commented on Aug 7, 2023

    @DanutGavrus
    Contributor

    Proposal

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

    When deleting a file, there is a space between the username and the '[Deleted message]'

    What is the root cause of that problem?

    In ReportActionItem, we set a top margin if the action is an attachment, but we do not verify that it was not deleted:

    !props.displayAsGroup && isAttachment ? styles.mt2 : undefined,

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

    We should also verify that:

    !props.displayAsGroup && isAttachment && !ReportActionsUtils.isDeletedAction(props.action) ? styles.mt2 : undefined,

    What alternative solutions did you explore?

    If we want also want to keep the space while waiting for the attachment to be deleted, we should update to:

    !props.displayAsGroup && isAttachment && (!ReportActionsUtils.isDeletedAction(props.action) || props.action.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE) ? styles.mt2 : undefined,
  4. melvin-bot commented on Aug 7, 2023

    @melvin-bot

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

  5. melvin-bot commented on Aug 7, 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
  6. yh-0218 commented on Aug 7, 2023

    @yh-0218
    Contributor

    Proposal

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

    When deleting a file, there is a space between the username and the '[Deleted message]'

    What is the root cause of that problem?

    !props.displayAsGroup && isAttachment ? styles.mt2 : undefined,

    Because we have styles.mt2 for all attachments.

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

    We have to remove styles.mt2 for only deleted attachments.
    We can get deleted status from action ReportActionsUtils.isDeletedAction(props.action).

    What alternative solutions did you explore? (Optional)

  7. bernhardoj commented on Aug 8, 2023

    @bernhardoj
    Contributor

    Proposal

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

    After deleting a thread message that is an attachment, the [Deleted Message] still has the margin value that is supposed to be for an attachment only.

    What is the root cause of that problem?

    When the message is an attachment, we apply a margin-top of 8.

    const isAttachment = _.has(props.action, 'isAttachment') ? props.action.isAttachment : ReportUtils.isReportMessageAttachment(message);

    !props.displayAsGroup && isAttachment ? styles.mt2 : undefined,

    Currently, we check if it's an attachment from the report action isAttachment and ReportUtils.isReportMessageAttachment(message)

    isAttachment is a local onyx data that is set when we add a new action/message.

    const isAttachment = _.isEmpty(text) && file !== undefined;

    isAttachment,

    This property is not available on the BE, so if you logout, isAttachment will be lost, and therefore the attachment check will rely on ReportUtils.isReportMessageAttachment(message).

    The problem is, when we delete a message, we never set the isAttachment to false. So, the [Deleted message] text will still have the margin-top of 8.

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

    Set isAttachment to false when we delete a message.

    const optimisticReportActions = {
    [reportActionID]: {
    pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE,
    previousMessage: reportAction.message,
    message: deletedMessage,
    errors: null,
    linkMetadata: [],
    },
    };

    What alternative solutions did you explore? (Optional)

    Remove props.action.isAttachment checks.

  8. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Aug 8, 2023
  9. changed the title [-]When deleting a file, there is a space between the username and the '[Deleted message]'[/-] [+][$1000] When deleting a file, there is a space between the username and the '[Deleted message]'[/+] on Aug 8, 2023
  10. melvin-bot commented on Aug 8, 2023

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

    @melvin-bot

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

  13. 49 remaining items

  14. trjExpensify commented on Aug 30, 2023

    @trjExpensify
    Contributor

    Hey everyone! Sorry for the delay, I've been out of office.

    Confirming payments as follows:

    • @bernhardoj - $1,500 for the bug fix & #urgency bonus. - paid!
    • @cubuspl42 - $1,500 for the C+ review & #urgency bonus - paid!
    • @ayazhussain79 - $250 for the bug report. - offer sent.
  15. ayazhussain79 commented on Aug 30, 2023

    @ayazhussain79
    Contributor

    @trjExpensify offer accepted, Thank you

  16. trjExpensify commented on Aug 30, 2023

    @trjExpensify
    Contributor

    Paid!

  17. bernhardoj commented on Aug 30, 2023

    @bernhardoj
    Contributor

    @trjExpensify Oh no, I think we shouldn't be getting paid yet as we still have a regression here.

    (I just realized we haven't linked the regression issue here, my bad)

    cc: @cubuspl42

  18. jakub-trzebiatowski commented on Aug 30, 2023

    @jakub-trzebiatowski
    Contributor

    @trjExpensify It's my fault. Do you know how we can clean this up, or should I start a topic on Slack?

    I also bumped the PRs that are blocking #25415, I hope we'll soon have this whole thing behind us

  19. trjExpensify commented on Aug 30, 2023

    @trjExpensify
    Contributor

    Ah, whoops! I've made the payments on those. I think the easiest thing to do is to simply deduct from your next issue bounties. Do you have any in the works you can make a note on to reduce the amount due accordingly?

  20. bernhardoj commented on Aug 30, 2023

    @bernhardoj
    Contributor

    @trjExpensify I have one that is currently pending for payment #23420

  21. trjExpensify commented on Aug 30, 2023

    @trjExpensify
    Contributor

    Excellent, commented there.

  22. jakub-trzebiatowski commented on Aug 31, 2023

    @jakub-trzebiatowski
    Contributor
  23. trjExpensify commented on Aug 31, 2023

    @trjExpensify
    Contributor

    Thanks, commented!

  24. added
    ReviewingHas a PR in review
    and removed on Oct 2, 2023
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.ExternalAdded to denote the issue can be worked on by a contributorReviewingHas a PR in reviewWeeklyKSv2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions