-
-
Notifications
You must be signed in to change notification settings - Fork 407
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
Add database archiving #1060
Add database archiving #1060
Conversation
Note, run failing due to legacy package.json version bug |
…into feat/db-delete
Test summaryRun details
View run in Cypress Dashboard ➡️ This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
…into feat/db-delete
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @chrismclarke, yes this approach is better than the current and will help to better handle the deletion/archiving of content 💪
Maybe as we discussed it could be good to have an other issue for further improvements regarding the deletion/archiving of content. Improvements that comes to my mind are :
- Allow to restore a specific version of a document (like the previous version of an how-to, since we keep an history of modifications)
- give the ability to an admin to delete a user/ map pin / content, by adding a delete button to them. This cases happend a lot and are not conviniently handled right now.
PR Type
PR Checklist
master
branch mergedDescription
Deleting documents from the database is not a trivial issue due to the way docs are cached. If a document is deleted from the server there is no way for a user to know it doesn't exist unless they fetch updates for that specific doc on the server (which might happen when opening a howto for example, but not for the full list on first load as this is inefficient - the full docs would need to be retrieved as there is no way to just query the list of ids that exist within firestore)
Currently the database deletes documents by removing the content and simply marking a
deleted
field and updating the timestamp. This is good in that it will prompt all users to receive the update to that document, however there are still 2 problems with this approach:This update adds a new system, whereby deleted docs are moved from their existing collection (solving 2), and populated in an
_archived
collection with both metadata stubs and full data stored separately (solving 1). An additional query is added for users to receive updates from the collection, and delete their own cached documents accordingly (keeping solution to initial problem). Additional bindings are made for the 3 existing database systems (firestore, firebase realtime and dexie) to process the deletes.Git Issues
Closes #531
Screenshots/Videos
If useful, provide screenshot or capture to highlight main changes