Code Monkey home page Code Monkey logo

Comments (5)

esh-g avatar esh-g commented on August 19, 2024

Proposal

Please re-state the issue

When deleting a workspace, the thread of the archived #admin room also gets archived which on reload, re-opens again.

What is the root cause of this issue?

The root cause is that we are archiving the thread on the front-end with optimistic data but it doesn't get archived in the backend.
Because, for other archived rooms as well, we don't archive the threads of archived rooms (like canceling a task). Therefore, I don't think here the user should lose the access to all the threads of an archived room, which is in line with what is happening on the backend.

We can see in the following code snippet, that we are passing all policyReports to Policy.deleteWorkspace() which includes all the policy related rooms.
https://github.com/Expensify/App/blob/c029dc509d03fd13ece058ba89ab25c4318a9050/src/pages/workspace/WorkspaceInitialPage.js#L76-L80

But this also includes the threads in the rooms as they possess the same policyID.

What changes do you think should be made to fix this problem?

We should make sure that the reports we are archiving are not threads. Therefore, we can modify the policyReports to the following:

const policyReports = _.filter(props.reports, (report) => report && report.policyID === policy.id && !ReportUtils.isThread(report));

What other alternative options did you explore? (Optional)

from plantonic.

esh-g avatar esh-g commented on August 19, 2024

Hi

from plantonic.

esh-g avatar esh-g commented on August 19, 2024

Hello there, this is a test

from plantonic.

esh-g avatar esh-g commented on August 19, 2024

Hello there, this is a test

from plantonic.

esh-g avatar esh-g commented on August 19, 2024

Hello there, this is a test

from plantonic.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.