Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.36k stars 2.79k forks source link

[Paid] [$250] Selecting yourself as the assignee should default Share somewhere to your self-DM #46918

Closed m-natarajan closed 1 month ago

m-natarajan commented 1 month ago

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 9.0.17-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 Expensify/Expensify Issue URL: Issue reported by: @srikarparsi Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1722970867440899

Action Performed:

  1. Click FAB
  2. Click Assign Task
  3. Enter in a title and click next
  4. Select yourself as the assignee

Expected Result:

Your self DM should be selected under Share somewhere

Actual Result:

Nothing happens to Share somewhere

Workaround:

unknown

Platforms:

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

Screenshots/Videos

https://github.com/user-attachments/assets/6b9a5fb3-f7c8-46ee-abee-005fa267c738

image (10)

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01ee964f440e728109
  • Upwork Job ID: 1820902098430288377
  • Last Price Increase: 2024-08-06
  • Automatic offers:
    • nkdengineer | Contributor | 103489021
Issue OwnerCurrent Issue Owner: @OfstadC
melvin-bot[bot] commented 1 month ago

Triggered auto assignment to @alexpensify (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] commented 1 month ago

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

melvin-bot[bot] commented 1 month ago

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

Krishna2323 commented 1 month ago

Proposal

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

Selecting yourself as the assignee should default Share somewhere to your self-DM

What is the root cause of that problem?

skipShareDestination is passes as true to setAssigneeValue. https://github.com/Expensify/App/blob/07008547603aa476f5e06206977a7d5daf8ad7c0/src/pages/tasks/TaskAssigneeSelectorModal.tsx#L195 https://github.com/Expensify/App/blob/07008547603aa476f5e06206977a7d5daf8ad7c0/src/pages/tasks/TaskAssigneeSelectorModal.tsx#L209

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

Remove the last param when creating new task or for both. We can also remove skipShareDestination param from setAssigneeValue.

What alternative solutions did you explore? (Optional)

nkdengineer commented 1 month ago

Proposal

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

Nothing happens to Share somewhere

What is the root cause of that problem?

We only set the share destination if the selection assignee is not the current user here.

https://github.com/Expensify/App/blob/fb0043ad97b023b7eb7ad7f57f91711d47213f3f/src/libs/actions/Task.ts#L777 https://github.com/Expensify/App/blob/fb0043ad97b023b7eb7ad7f57f91711d47213f3f/src/libs/actions/Task.ts#L798

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

If the selected assignee is the current user, we should add the share somewhere as the self-chat. We can add a else condition for this case like this.

OPTIONAL: We can also call setAssigneeChatReport inside the case the current user is the assignee. If we want to do that, we can move the logic set assign chat report and share somewhere to outside the if condition here and add a else condition to assign the report as the selfDM.

else {
    const selfDMReportID = ReportUtils.findSelfDMReportID();
    // If there is no share destination set, automatically set it to the assignee chat report
    // This allows for a much quicker process when creating a new task and is likely the desired share destination most times
    if (!shareToReportID && !skipShareDestination) {
        setShareDestinationValue(selfDMReportID ?? '-1');
    }
}

https://github.com/Expensify/App/blob/fb0043ad97b023b7eb7ad7f57f91711d47213f3f/src/libs/actions/Task.ts#L777

What alternative solutions did you explore? (Optional)

kpadmanabhan commented 1 month ago

I was trying to reproduce the issue. However it works as expected as in test steps in staging.new.expensify.com @m-natarajan : am i missing any steps? isnt this what the expected behaviour is?

https://github.com/user-attachments/assets/8a910f06-a54d-4c88-9275-deb8f553057d

srikarparsi commented 1 month ago

Hi @kpadmanabhan, the expected behavior is if you select yourself in the Assignee field, then your self DM should automatically populate in the Share somewhere field.

srikarparsi commented 1 month ago

@Pujan92 have you had a chance to review proposals?

Pujan92 commented 1 month ago

@Krishna2323's RCA is incorrect, we aren't passing skipShareDestination in the function call.

@nkdengineer's RCA and solution looks good to me where they suggested to use else condition for the isCurrentUser part.

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

melvin-bot[bot] commented 1 month ago

Current assignee @srikarparsi is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.

melvin-bot[bot] commented 1 month ago

πŸ“£ @nkdengineer πŸŽ‰ 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 πŸ“–

alexpensify commented 1 month ago

Easy Melvin, the PR is being worked on.

nkdengineer commented 1 month ago

@Pujan92 this PR is ready for review

alexpensify commented 1 month ago

This was merged 3 days ago, so waiting for automation to kick in here.

melvin-bot[bot] commented 1 month ago

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

alexpensify commented 1 month ago

Next Steps

@OfstadC, it looks like automation hasn't kicked in here, and I'm not sure if it will. If automation fails, then the payment date will be tomorrow. Here's the summary:

Payouts due: 2024-08-27

Upwork job is here.

Heads up, I will be offline until Tuesday, September 3, 2024, and will not actively watch over this GitHub during that period.

If anything urgent is needed here, please ask for help in the #expensify-open-source Slack Room-- thanks!

OfstadC commented 1 month ago

Payment Summary

OfstadC commented 1 month ago

@Pujan92 any regression testing to propose here?

Pujan92 commented 1 month ago

Regression Test Steps

  1. Click FAB -> Assign Task
  2. Provide a title and click next
  3. Select yourself as the assignee
  4. Verify that your self-DM should be selected in Share somewhere
OfstadC commented 1 month ago

Thanks @Pujan92

https://github.com/Expensify/Expensify/issues/423739

garrettmknight commented 1 month ago

$250 approved for @Pujan92