Remove NoSync
versions of root branch primitives
#5057
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
There are several
stepAtNoSync
variations exposed, these seem to be intended to be used to:Cli
getCurrentBranch combinators against a branch which hasn't been "committed" yet.Which seems reasonable, but in reality it's resulted in places in code where the in-memory branch has been altered, but it hasn't been saved to SQLite yet, which is pretty dangerous because:
This change removes these combinators.
We still have an atomicity problem in syncing UCM and SQLite, but moving the sqlite and memory updates right next to each other vastly decreases the likelihood something will go wrong here.
The motivation for this is that we'll be performing edits to branches in multiple roots soon, so relying on a single in-memory root is no longer feasible, so NoSync doesn't make sense.
Implementation notes
NoSync
combinators with synchronous versions. Inupdate.old
behaviour is changed slightly so patch propagation and update are now in different causals, but since that command is deprecated I figure it's fine. If we'd like to maintain the same old behaviour I can do the extra work for it.Test coverage
Existing transcripts should cover it.
Loose ends
We should investigate better approaches to guaranteeing atomicity between SQLite and UCM, e.g. masking ctrl-c, checking that they're synced at each prompt render, etc.