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

Fix backup/restore feature #238

Merged
merged 1 commit into from
Apr 25, 2019
Merged

Fix backup/restore feature #238

merged 1 commit into from
Apr 25, 2019

Conversation

kevinbader
Copy link
Contributor

Description

Enabling strict schema validation broke the restore feature, because fastify-swagger doesn't support the required type "string" with format "binary". Furthermore, the newly introduced caching required restarting the API after restoring a backup.

This PR fixes that by:

  • using AnyValue as the body schema type
  • apply cache invalidation after restore (or restore attempt)

Closes #237

Test

happy path:

  • log in as root
  • open the hamburger menu and download a backup
  • change things (edit a project or add a new project)
  • open the hamburger menu and restore the backup
  • log in again and verify that the data has been reset

unhappy path:

  • try to upload something else, like a non-gzip file or a gzip files that contains other things (I haven't tested the latter, actually)

- fastify-swagger doesn't support string/binary body type => went for AnyValue
- cache invalidation after restore (or restore attempt)
@mathiashoeld mathiashoeld merged commit d862116 into master Apr 25, 2019
@mathiashoeld mathiashoeld deleted the fix-backup-restore branch April 25, 2019 14:57
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

Successfully merging this pull request may close these issues.

Fix backup/restore feature
2 participants