Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new slack #12

Open
esh-g opened this issue Sep 7, 2023 · 5 comments
Open

new slack #12

esh-g opened this issue Sep 7, 2023 · 5 comments

Comments

@esh-g
Copy link
Owner

esh-g commented Sep 7, 2023

TEST

Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1692810892302423

@esh-g
Copy link
Owner Author

esh-g commented Sep 7, 2023

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)

@esh-g
Copy link
Owner Author

esh-g commented Sep 7, 2023

Hi

@esh-g
Copy link
Owner Author

esh-g commented Sep 7, 2023

Hello there, this is a test

2 similar comments
@esh-g
Copy link
Owner Author

esh-g commented Sep 7, 2023

Hello there, this is a test

@esh-g
Copy link
Owner Author

esh-g commented Sep 7, 2023

Hello there, this is a test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant