From dcb2dde4562b62f5f44abb6ff0f02235eaf7bc63 Mon Sep 17 00:00:00 2001 From: Ragnor Comerford Date: Wed, 27 May 2026 12:04:07 +0200 Subject: [PATCH] mr-668: drop unused State extractor from 7 read-only handlers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After the routing-middleware refactor moved the engine into the per-graph `GraphHandle` (extracted via `Extension>`), seven read-only handlers — `server_snapshot`, `server_read`, `server_export`, `server_schema_get`, `server_branch_list`, `server_commit_list`, `server_commit_show` — kept an unused `State(_state): State` extractor. Drop it. Each request avoids one `FromRequestParts` clone of `AppState`'s Arcs. Handlers that actually use state (workload admission for write paths, `server_policy` for management endpoints) keep theirs. Co-Authored-By: Claude Opus 4.7 (1M context) --- crates/omnigraph-server/src/lib.rs | 7 ------- 1 file changed, 7 deletions(-) diff --git a/crates/omnigraph-server/src/lib.rs b/crates/omnigraph-server/src/lib.rs index 01312c9..13d0244 100644 --- a/crates/omnigraph-server/src/lib.rs +++ b/crates/omnigraph-server/src/lib.rs @@ -1497,7 +1497,6 @@ fn authorize_request( /// count) for every table on the branch. Defaults to `main` when `branch` is /// omitted. Read-only. async fn server_snapshot( - State(_state): State, Extension(handle): Extension>, actor: Option>, Query(query): Query, @@ -1543,7 +1542,6 @@ async fn server_snapshot( /// match the parameters declared by the query. Returns rows as a JSON array /// plus a `columns` list. Read-only. async fn server_read( - State(_state): State, Extension(handle): Extension>, actor: Option>, Json(request): Json, @@ -1616,7 +1614,6 @@ async fn server_read( /// streams the entire branch. Suitable for large exports — the response is /// streamed, not buffered. Read-only. async fn server_export( - State(_state): State, Extension(handle): Extension>, actor: Option>, Json(request): Json, @@ -1759,7 +1756,6 @@ async fn server_change( /// Useful for clients that want to introspect available types and tables /// before constructing GQ queries. Read-only. async fn server_schema_get( - State(_state): State, Extension(handle): Extension>, actor: Option>, ) -> std::result::Result, ApiError> { @@ -1948,7 +1944,6 @@ async fn server_ingest( /// /// Returns branch names sorted alphabetically. Read-only. async fn server_branch_list( - State(_state): State, Extension(handle): Extension>, actor: Option>, ) -> std::result::Result, ApiError> { @@ -2177,7 +2172,6 @@ async fn server_branch_merge( /// Filter by `branch` to get the commits on a single branch (most recent /// first); omit to list across all branches. Read-only. async fn server_commit_list( - State(_state): State, Extension(handle): Extension>, actor: Option>, Query(query): Query, @@ -2223,7 +2217,6 @@ async fn server_commit_list( /// Returns the commit's manifest version, parent commit(s), and creation /// metadata. Read-only. async fn server_commit_show( - State(_state): State, Extension(handle): Extension>, actor: Option>, Path(commit_id): Path,