From 106dca20fef667ef4605528d51c2b9968731242a Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Sun, 23 Aug 2026 23:54:25 +0200 Subject: daemon/api: Remove `add_history` This request is a footgun, as it will leave commands that never return (e.g. `shutdown`, `exit`, etc.) unrecorded. --- crates/daemon/src/api/history.rs | 32 +++----------------------------- 1 file changed, 3 insertions(+), 29 deletions(-) (limited to 'crates/daemon/src/api/history.rs') diff --git a/crates/daemon/src/api/history.rs b/crates/daemon/src/api/history.rs index 2229e5b1..afd823b1 100644 --- a/crates/daemon/src/api/history.rs +++ b/crates/daemon/src/api/history.rs @@ -4,7 +4,7 @@ use dashmap::DashMap; use eyre::Result; use time::OffsetDateTime; use tokio_stream::Stream; -use tonic::{IntoRequest, Request, Response, Status}; +use tonic::{Request, Response, Status}; use tracing::{Level, instrument}; use crate::{ @@ -20,8 +20,8 @@ use turtle_api::{ generated::{ DAEMON_PROTOCOL_VERSION, history::{ - AddHistoryRequest, EndHistoryReply, EndHistoryRequest, HistoryEntry, HistoryEventKind, - HistoryReply, HistoryRequest, StartHistoryReply, StartHistoryRequest, TailHistoryReply, + EndHistoryReply, EndHistoryRequest, HistoryEntry, HistoryEventKind, HistoryReply, + HistoryRequest, StartHistoryReply, StartHistoryRequest, TailHistoryReply, TailHistoryRequest, history_server::{History as HistorySvc, HistoryServer}, }, @@ -104,32 +104,6 @@ impl HistorySvc for HistoryService { Ok(Response::new(HistoryReply { entries })) } - #[instrument(skip_all, level = Level::INFO)] - async fn add_history( - &self, - request: Request, - ) -> Result, Status> { - let req = request.into_inner(); - let start_req = req.start.expect("is some"); - - let start_response = self - .start_history(start_req.into_request()) - .await? - .into_inner(); - let end_responnse = self - .end_history( - EndHistoryRequest { - id: start_response.id, - exit: req.exit, - duration: req.duration, - } - .into_request(), - ) - .await?; - - Ok(end_responnse) - } - #[instrument(skip_all, level = Level::INFO)] async fn start_history( &self, -- cgit v1.3.1