openly-rails icon indicating copy to clipboard operation
openly-rails copied to clipboard

Selective commits can lead to incorrect backups

Open FinnWoelm opened this issue 6 years ago • 1 comments

When selectively applying changes during new commit, the backup created can be incorrect. A new version will be created, which triggers a new backup request as opposed to taking any existing backup.

Here is what should be done: When selectively committing changes, a backup will definitely already exist for the file. It's just that the backup may not have the right name.

For example, we have two backups:

  • version 1 named name 1
  • version 2 named name 2

On a selective commit, the user may want version 1 named name 2 OR version 2 named name 1 — neither of which exist in the archive.

Therefore, when creating a new version, ...

  • check if backup with same name & content already exists. If so, reuse that.
  • check if backup with content already exists (but different time). If so, duplicate that content and assign the new name.

FinnWoelm avatar Feb 07 '19 01:02 FinnWoelm

Side note: On selective commit, we should actually disable the ability to create any new backups of remote. It is never needed and if it's happening, then something is going wrong.

FinnWoelm avatar Feb 07 '19 01:02 FinnWoelm