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

Safer Saving #680

Closed
jthrilly opened this issue Nov 6, 2020 · 0 comments · Fixed by #682
Closed

Safer Saving #680

jthrilly opened this issue Nov 6, 2020 · 0 comments · Fixed by #682

Comments

@jthrilly
Copy link
Member

jthrilly commented Nov 6, 2020

We have had reports from users of corrupted files while working in Architect, and so would like to change the way that saving works to help with this.

Proposed plan:

  • Opening will continue to work on an unbundled temporary protocol in a temp directory, but will also immediately create a duplicate of the protocol that was opened in the same location as the protocol, in the format {protocol-name}.netcanvas.backup-{timestamp}. Failure to create the backup file will be a hard failure for the open process.
  • Editing works as usual
  • When saving:
    • the app zips the protocol inside the temp directory
    • once complete it tries to open the zip contents to verify it is a valid zip (there may be a better way to validate a zip using a library)
    • if this succeedes, the temp bundled protocol is copied to the user location.
    • if the copy succeedes, the temporary file is deleted, and a new temporary file is created.
  • When closing an open protocol without saving, the temporary file is deleted (including when closing the app)
  • Errors in the process should alert the user to the backup file and tell them how to restore (by renaming it)
@wwqrd wwqrd self-assigned this Nov 12, 2020
@jthrilly jthrilly linked a pull request Nov 25, 2020 that will close this issue
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants