aboutsummaryrefslogtreecommitdiffstats
path: root/src/remake/proposal.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/remake/proposal.rs')
-rw-r--r--src/remake/proposal.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/remake/proposal.rs b/src/remake/proposal.rs
index 7695b4c..f8b3b0e 100644
--- a/src/remake/proposal.rs
+++ b/src/remake/proposal.rs
@@ -86,6 +86,9 @@ pub(super) struct ExpiredRemake {
pub(super) struct Supersede {
pub(super) force: Force,
pub(super) active_peers: HashSet<String>,
+ /// Who asks (the API's user): the proposal, and the decisions aborting the remakes
+ /// it supersedes, are written as theirs, as the rules judge them (`access::rules`).
+ pub(super) by: Option<String>,
}
#[derive(Debug, thiserror::Error)]
@@ -126,8 +129,9 @@ pub(super) async fn propose<H: Host>(
let me = host.node_id();
let started = host.remake().started_at().plus_ms(grace);
let base_at_commit = kind::by_name(&proposal.kind).is_some_and(|kind| kind.base_at_commit());
+ let by = supersede.by.clone();
let record = host
- .commit_doc(move |doc| -> Result<Record, StartError> {
+ .commit_doc_for(by, move |doc| -> Result<Record, StartError> {
let mut all = records::load_all(doc);
if let Some((open, _)) = all.iter().find(|(_, record)| {
record.proposal.from_epoch == proposal.from_epoch