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.48k stars 2.82k forks source link

[$250] LHN - Chat that contains only task disappears from LHN #50478

Open lanitochka17 opened 1 week ago

lanitochka17 commented 1 week 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.46-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: N/A Email or phone of affected tester (no customers): applausetester+bg@applause.expensifail.com Issue reported by: Applause - Internal Team

Action Performed:

  1. Login with expensifail account
  2. Start a new chat
  3. Create a task on the newly created chat
  4. Go to another chat

Expected Result:

Chat that contains only task does not disappear from from LHN

Actual Result:

Chat that contains only task disappears from LHN when navigating to other chats

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Add any screenshot/video evidence

https://github.com/user-attachments/assets/23d08237-3d86-46c6-91cf-32048c5b7ead

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021843919279680546076
  • Upwork Job ID: 1843919279680546076
  • Last Price Increase: 2024-10-09
  • Automatic offers:
    • hoangzinh | Reviewer | 104415093
Issue OwnerCurrent Issue Owner: @hoangzinh
melvin-bot[bot] commented 1 week ago

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

mkzie2 commented 1 week ago

Proposal

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

https://github.com/Expensify/App/blob/8db63476c908f490b808fb987e9f063653af2614/src/libs/actions/Task.ts#L220-L233

like we did when creating a new comment:

https://github.com/Expensify/App/blob/8db63476c908f490b808fb987e9f063653af2614/src/libs/actions/Report.ts#L492-L498

so the chat disappears from LHN:

https://github.com/Expensify/App/blob/8db63476c908f490b808fb987e9f063653af2614/src/libs/SidebarUtils.ts#L141

until the API CreateTask is called succesfully.

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

Add a logic to update notificationPreference to place:

    const shouldUpdateNotificationPrefernece = !isEmptyObject(parentReport) && ReportUtils.getReportNotificationPreference(parent) === CONST.REPORT.NOTIFICATION_PREFERENCE.HIDDEN;

    if (shouldUpdateNotificationPrefernece) {
        optimisticData.push({
            onyxMethod: Onyx.METHOD.MERGE,
            key: `${ONYXKEYS.COLLECTION.REPORT}${parentReportID}`,
            value: {
                participants: {
                    [currentUserAccountID]: {notificationPreference: CONST.REPORT.NOTIFICATION_PREFERENCE.ALWAYS},
                },
                notificationPreference: CONST.REPORT.NOTIFICATION_PREFERENCE.ALWAYS // Optional
            },
        });
    }

What alternative solutions did you explore? (Optional)

Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.

Nodebrute commented 1 week ago

I am unable to reproduce this on the latest main. @mkzie2, could you please list all the steps to reproduce this issue?

https://github.com/user-attachments/assets/70f85c69-1b9d-43df-a63b-56531d19d1e2

VictoriaExpensify commented 1 week ago

Agree this is an isue and we should fix it

melvin-bot[bot] commented 1 week ago

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

melvin-bot[bot] commented 1 week ago

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

hoangzinh commented 5 days ago

@mkzie2's RCA and solution looks good to me

Link to proposal https://github.com/Expensify/App/issues/50478#issuecomment-2400793353

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

melvin-bot[bot] commented 5 days ago

Triggered auto assignment to @marcochavezf, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

marcochavezf commented 1 day ago

Thanks for the review @hoangzinh, assigning @mkzie2 πŸš€

melvin-bot[bot] commented 1 day ago

πŸ“£ @hoangzinh πŸŽ‰ An offer has been automatically sent to your Upwork account for the Reviewer role πŸŽ‰ Thanks for contributing to the Expensify app!

Offer link Upwork job

melvin-bot[bot] commented 1 day ago

πŸ“£ @mkzie2 You have been assigned to this job! Please apply to the Upwork job and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review πŸ§‘β€πŸ’» Once you apply to this job, your Upwork ID will be stored and you will be automatically hired for future jobs! Keep in mind: Code of Conduct | Contributing πŸ“–