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

Method for deleting dictionary data needed #664

Open
peteroatley opened this issue Mar 26, 2024 · 5 comments
Open

Method for deleting dictionary data needed #664

peteroatley opened this issue Mar 26, 2024 · 5 comments
Assignees
Labels
enhancement New feature or request high priority Something that should be given priority in fixing or implementing

Comments

@peteroatley
Copy link
Collaborator

At present there is no option in the Webonary Admin interface to delete the data for a Mongo DB dictionary, there is only a button to delete a WordPress dictionary.

This is needed as we may get a request from a dictionary complier to remove their data. It can be done by directly working with the MongoDB and deleting the WP data but it would be good to have an automated procedure that does it and not have to work out each time what needs deleting.

@peteroatley peteroatley added enhancement New feature or request high priority Something that should be given priority in fixing or implementing labels Mar 26, 2024
@stevendyk
Copy link
Member

@phillip-hopper: webonary-cloud-api/lambda/deleteDictionary.ts appears to have the code for a deleteDictionary API call. Can this be utilized from a WP admin console?

@phillip-hopper
Copy link
Collaborator

@peteroatley There is already a button to delete the cloud data for a site.
image

@peteroatley
Copy link
Collaborator Author

I tested this on .org and the Cloud data was deleted.

From the text in brackets, I think we weren't sure what was being deleted. Could we update the text to state what is now being deleted or remove it? Does the button delete both posts and cloud data depending on what exists?

When I looked at another test database it didn't have any posts to delete because it is cloud only. I looked at an older database and it had both posts and cloud data.

@peteroatley
Copy link
Collaborator Author

peteroatley commented May 14, 2024

On the Dictionary Webonary Admin page Data (Upload) tab:
Delete Data section:

Remove the text: "(deletes all posts in the category "webonary")"
Remove the text: "You are not in your testing environment!"
Below "Delete Data" add the following text:

"In this section you can delete either the cloud dictionary data or Wordpress posts data.

To delete cloud dictionary data, make sure the "Use cloud backend" box above is checked.
To delete Wordpress dictionary data, make sure the "Use cloud backend" box above is unchecked.

Then enter your password and click on Delete.

Older dictionaries which were later uploaded to the cloud may have both types of data."

@peteroatley
Copy link
Collaborator Author

I tested deleting a dictionary and checked the data on MongoDB and it looks like that is working and all data is deleted including the reversal indexes.

Phil says that data from the reversal dictionary is not fully deleted because the table isn't deleted. If we decide we need to fully delete this data Phil gave two options:

  1. Copy the reversal index, delete the data from the copy and then overwrite the original. This is a slow process.

  2. Re-write the reversal indexes so that each dictionary has a table rather than storing all the data in one table. This is the better option but is more work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request high priority Something that should be given priority in fixing or implementing
Projects
Status: Done - Working in Prod
Development

No branches or pull requests

3 participants