Repository navigation
Proposing the same write again withdraws the older held copy - #48
Merged
Merged
Conversation
Signed-off-by: Ermag <ermag.bg@gmail.com>
…oposal, link the new copy Signed-off-by: Ermag <ermag.bg@gmail.com>
…plicates Signed-off-by: Ermag <ermag.bg@gmail.com> # Conflicts: # crates/rowbit-web/dist/assets/app.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What happened
In the demo, the review page had two held copies of
UPDATE orders SET status = 'cancelled' WHERE status = 'pending': #2, left over from a run on Oct 31, and #4, the one the agent had just proposed. The page lists held changes oldest first, so the approval went to #2. It applied (1,284 rows), while #4, the change the agent was watching, correctly stayedheld. Approving #4 afterwards failed with "drift since preview", because the rows were already cancelled.Change status was never stale; the person approved a stale duplicate.
Fix
When an agent proposes a statement that, after normalizing, is the same as one of its own still-held changes on the same database, Rowbit withdraws the older copy on the agent's behalf (the agent is the only actor allowed to withdraw) and logs a
Supersedednote naming the new change. A blocked re-proposal leaves the older copy alone. The review page then shows one copy, the one the agent is waiting for.Engine::supersedeinrowbit-engine, called fromproposeafter the new change is decided.proposing_again_withdraws_the_older_held_copy(MariaDB and MySQL), including a differently spelled copy and an unrelated held change that stays held.attacks.rsself_approvalnow expects one held change after re-proposing.change-lifecycle.md) and CHANGELOG.rowbit-clidemo::never_writes_into_a_directory_of_yoursfails locally only because the demo is running on :8080.