-
Couldn't load subscription status.
- Fork 5
Description
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
- Perform some commits on a vault to produce a commit log that appears like
c1 -> c2 -> c3 - Save the commit ID for
c3 - Use
versionto move toc1: expected commit log nowc1 - Perform another commit: expected commit log now
c1 -> c4 - Save the commit ID for
c4 - Use
versionto move toc3(with its old commit ID): commit log now back toc1 -> c2 -> c3 - Use version to move to
c4: commit log now back toc1 -> 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
- initial discussion of the
versioncommand https://gitlab.com/MatrixAI/Engineering/Polykey/js-polykey/-/merge_requests/205#note_688569888 - initial discussion of this problem https://gitlab.com/MatrixAI/Engineering/Polykey/js-polykey/-/merge_requests/205#note_694692000 (lots of relevant commentary in that entire thread) and final comment here https://gitlab.com/MatrixAI/Engineering/Polykey/js-polykey/-/merge_requests/205#note_708685220