Skip to content

[$1000] Web - Edit and delete button are not available for normal message in mac after changing default contact #21948

Closed

Description

@kbecciv

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:

Precondition: user should have more then 1 contact method verified

  1. Open the app
  2. Open any report
  3. Send few messages
  4. Change default contact method
  5. Revisit report opened in step 2 and hover on latest sent messages (sent in step 3)

Expected Result:

App should display edit and delete for normal messages

Actual Result:

pp does not display edit and delete for normal messages after changing default contact method

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 ONLY
  • MacOS / Desktop

Version Number: 1.3.34-1
Reproducible in staging?: n/a
Reproducible in production?: n/a
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

no.edit.delete.btn.change.contact.method.mov

Expensify/Expensify Issue URL:
Issue reported by: @dhanashree-sawant
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1688029345913139

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~016e71cf3db941fc35
  • Upwork Job ID: 1675215183989825536
  • Last Price Increase: 2023-07-08

Activity

  1. added
    Daily
    Needs Reproduction
    Bug
    on Jun 30, 2023
  2. melvin-bot commented on Jun 30, 2023

    @melvin-bot

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

  3. melvin-bot commented on Jun 30, 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
  4. hungvu193 commented on Jun 30, 2023

    @hungvu193
    Contributor

    Proposal

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

    Web - Edit and delete button are not available for normal message in mac after changing default contact

    What is the root cause of that problem?

    After changing contact method, the reportAction is not updated with latest contact method email, so the condition inside canDeleteReportAction will be false:

     if (reportAction.actorEmail === sessionEmail) {
            return true;
        }

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

    We should use loginList to compare with current actorEmail, if loginList includes reportAction.actorEmail then return true in here

    if ( loginList.includes(reportAction.actorEmail)) {
      return true
    }

    What alternative solutions did you explore? (Optional)

    N/A

  5. c3024 commented on Jun 30, 2023

    @c3024
    Contributor

    Proposal

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

    After changing default contact, the edit and delete icon are missing on context actions.

    What is the root cause of that problem?

    After changing default contact method sessionEmail changes to this but reportAction email remains the same as earlier until page reloads again and BE sends the updated email for reportAction. And this returns false
    https://github.com/Expensify/App/blob/0bbf3fccfce0994ddf4fd9e95fb33dd9edbd1868/src/libs/ReportUtils.js#L203C1-L205C56
    and the delete and edit are not shown

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

    We should use check if the selected contact id is in the validated logins list and if it exists we should return true.
    For this we should add a variable called validatedLoginList and filter the validated logins from Onyx for LOGIN_LIST as follows in ReportUtils.js

    let validatedLoginList;
    Onyx.connect({
        key: ONYXKEYS.LOGIN_LIST,
        callback: (val) => (validatedLoginList = _.map(_.filter(val, login => login.validatedDate), login => login.partnerUserID)),
    });
    

    we can replace the above equal comparison mentioned in RCA like this

    -reportAction.actorEmail === currentUserEmail &&
    +validatedLoginList.includes(reportAction.actorEmail) &&
    

    Same can be applied for canDeleteReportAction here
    https://github.com/Expensify/App/blob/0bbf3fccfce0994ddf4fd9e95fb33dd9edbd1868/src/libs/ReportUtils.js#L259C1-L260C21

    What alternative solutions did you explore? (Optional)

    Use loginList which was already available but this includes non validated logins as well. So if one may add some sender's email id simply in new contact page (and not validate) and they would get edit and delete actions for that reportAction. This is not desirable.

  6. added
    External
    on Jul 1, 2023
  7. changed the title [-]Web - Edit and delete button are not available for normal message in mac after changing default contact[/-] [+][$1000] Web - Edit and delete button are not available for normal message in mac after changing default contact[/+] on Jul 1, 2023
  8. melvin-bot commented on Jul 1, 2023

    @melvin-bot
  9. added
    Help Wanted
    on Jul 1, 2023
  10. melvin-bot commented on Jul 1, 2023

    @melvin-bot

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

  11. melvin-bot commented on Jul 1, 2023

    @melvin-bot

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

  12. 6 remaining items

  13. MitchExpensify commented on Jul 3, 2023

    @MitchExpensify
    Contributor

    Not overdue, Melvin

  14. mollfpr commented on Jul 7, 2023

    @mollfpr
    Contributor

    Reviewing proposal!

  15. melvin-bot commented on Jul 8, 2023

    @melvin-bot

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

  16. mollfpr commented on Jul 10, 2023

    @mollfpr
    Contributor

    This issue is not reproducible. Is fixed in the accountID migration PR #22327

  17. MitchExpensify commented on Jul 10, 2023

    @MitchExpensify
    Contributor

    @mollfpr thanks, sounds like reporting payment is all thats due here - agreed?

  18. mollfpr commented on Jul 11, 2023

    @mollfpr
    Contributor
  19. MitchExpensify commented on Jul 11, 2023

    @MitchExpensify
    Contributor

    Awesome, invite sent here for reporting payment @dhanashree-sawant 👍 https://www.upwork.com/jobs/~016e71cf3db941fc35

  20. dhanashree-sawant commented on Jul 12, 2023

    @dhanashree-sawant

    @MitchExpensify, Thanks!
    Offer accepted.

  21. MitchExpensify commented on Jul 12, 2023

    @MitchExpensify
    Contributor

    Awesome, paid!

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

Metadata

Metadata

Labels

BugDailyExternalHelp WantedNeeds Reproduction

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions