Skip to content

Prevent checking out discarded vault commit IDs with version #252

@joshuakarp

Description

@joshuakarp

Describe the bug

The version command for the vaults can currently move to commit IDs that are expected to be discarded. When checked out at an earlier commit ID and a mutation is performed, we expect to discard the later commit IDs (respective to the earlier checked out commit) such that they are no longer valid and inaccessible.

To Reproduce

  1. Perform some commits on a vault to produce a commit log that appears like c1 -> c2 -> c3
  2. Save the commit ID for c3
  3. Use version to move to c1: expected commit log now c1
  4. Perform another commit: expected commit log now c1 -> c4
  5. Save the commit ID for c4
  6. Use version to move to c3 (with its old commit ID): commit log now back to c1 -> c2 -> c3
  7. Use version to move to c4: commit log now back to c1 -> c4

Expected behavior

In step 5, instead of reverting to the earlier commit history, we would instead expect this to be an invalid operation. We want to restrict the "branching" potential for our vault log (for simplicity purposes), such that any mutations performed on a vault when checked out at an earlier commit will discard all commits later than the current one.

Additional context

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingdevelopmentStandard developmentr&d:polykey:core activity 1Secret Vault Sharing and Secret History Management

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions