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
2.97k stars 2.48k forks source link

[$250] Task - Deleted #admins room displayed in share somewhere when creating task #41062

Open izarutskaya opened 1 week ago

izarutskaya 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: 1.4.66-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: https://expensify.testrail.io/index.php?/tests/view/4516164 Logs: https://stackoverflow.com/c/expensify/questions/4856 Issue reported by: Applause-Internal team

Action Performed:

  1. Open the app and log in
  2. Create a workspace
  3. Add some message to #admins room
  4. Tap FAB > Assign task
  5. Create a task and share in the #admins room
  6. Delete the workspace
  7. Tap FAB > Assign task
  8. Open Share somewhere on the task confirmation screen

Expected Result:

Admins room from the deleted workspace is not displayed

Actual Result:

Admins room from the deleted workspace is displayed and can be selected

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

https://github.com/Expensify/App/assets/115492554/c6509d83-2b77-4774-936f-4399e5494085

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0190dd051f8a814833
  • Upwork Job ID: 1784888107450617856
  • Last Price Increase: 2024-04-29
  • Automatic offers:
    • c3024 | Contributor | 0
    • tienifr | Contributor | 0
melvin-bot[bot] commented 1 week ago

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

izarutskaya commented 1 week ago

We think this issue might be related to the #vip-vsb.

tienifr commented 1 week ago

Proposal

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

Admins room from the deleted workspace is displayed and can be selected

What is the root cause of that problem?

We're using useOptionsList hook to get optionList

When reports change we update the optionList in

https://github.com/Expensify/App/blob/e28047876767a404d845390ad670058894e6cbe6/src/components/OptionListContextProvider.tsx#L50-L53

But we just get the last updated report

https://github.com/Expensify/App/blob/e28047876767a404d845390ad670058894e6cbe6/src/components/OptionListContextProvider.tsx#L59

In this case it's not correct since when users delete WS, 3 reports are updated (chat, admin, announce) -> just only chat is updated

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

We should not update the last updated report because of the above reason, instead of that we can do the same with personalDetails

https://github.com/Expensify/App/blob/e28047876767a404d845390ad670058894e6cbe6/src/components/OptionListContextProvider.tsx#L114

        const newReports = OptionsListUtils.createOptionList({}, reports).reports;

        setOptions((prevOptions) => {
            const newOptions = {...prevOptions};
            newOptions.reports = newReports
            return newOptions;
        });

To improve the performance, we can compare the newReports with the current reports before decide to update them

What alternative solutions did you explore? (Optional)

NA

melvin-bot[bot] commented 1 week ago

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

melvin-bot[bot] commented 1 week ago

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

parasharrajat commented 1 week ago

Will reivew it tomorrow morning.

c3024 commented 5 days ago

@parasharrajat I can take this if you are OOO and have limited capacity. (context)

garrettmknight commented 3 days ago

@c3024 you're up!

melvin-bot[bot] commented 3 days ago

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

c3024 commented 3 days ago

@tienifr 's proposal here looks good to me.

πŸŽ€ πŸ‘€ πŸŽ€ C+ Reviewed

melvin-bot[bot] commented 3 days ago

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

melvin-bot[bot] commented 3 days ago

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