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

What should Clear do? (and deleting uploaded files) #37

Open
joyously opened this issue Aug 24, 2017 · 3 comments
Open

What should Clear do? (and deleting uploaded files) #37

joyously opened this issue Aug 24, 2017 · 3 comments

Comments

@joyously
Copy link

While trying to see if a storage backend needs to handle deleting uploaded files, I read this code in the clear function.
https://github.com/mavoweb/mavo/blob/1281b72b2154d9171676c7c5d87cf12a00b2887b/src/mavo.js#L322

At face value, it looks fine (actually the store function does not take a parameter), but should store be called here? Shouldn't the data only be saved when the user chooses Save?

It did not help me figure out if I need to delete an uploaded file. How is that handled?

@LeaVerou
Copy link
Member

LeaVerou commented Aug 26, 2017

It's up to the implementation. Either storing an empty file or deleting the file would both be acceptable behaviors. Currently, AFAIK none of the existing file-based storage backends delete the file. There is currently no way to do so via Mavo.

@joyously
Copy link
Author

Your answer sounds like it is referring to the saved data that some backends store as files.
My question was about uploaded files, which is part of the data that is being stored.
Additionally, it is about whether storing data before clearing it is the expected sequence. I know if I edit something and then click Clear, I do not want my edits saved first, or I would have clicked Save.

@LeaVerou
Copy link
Member

LeaVerou commented Oct 3, 2017

You're right, Clear shouldn't store data before clearing, that's against expectation, and could be quite catastrophic. Btw Clear was moved to a plugin yesterday: https://plugins.mavo.io/plugin/clear
I should still fix this there.

@LeaVerou LeaVerou transferred this issue from mavoweb/mavo Feb 21, 2019
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

2 participants