From 92e727b1fcfe69f5baff6839a7b48227d815a4be Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Tue, 19 May 2026 18:49:22 +0200 Subject: [PATCH] refactor: remove unused GET /evaluations/feedbacks/all endpoint (#24778) GET /evaluations/feedbacks/all returned the entire feedback table in a single response (flagged as a Medium OOM risk for admins in open-webui#22206). Its only frontend wrapper, getAllFeedbacks in src/lib/apis/evaluations/index.ts, is dead: nothing imports or calls it anywhere in the codebase. The endpoint is a redundant view-only twin of GET /evaluations/feedbacks/all/export, which is what the admin Feedbacks UI actually uses. Removes the endpoint, the now-unused FeedbackResponse import in the evaluations router, and the dead getAllFeedbacks frontend wrapper. The shared Feedbacks.get_all_feedbacks data-layer method is kept, since the live /feedbacks/all/export endpoint still uses it. Ref: open-webui#22206 Co-authored-by: Claude Opus 4.7 (1M context) --- backend/open_webui/routers/evaluations.py | 7 ----- src/lib/apis/evaluations/index.ts | 31 ----------------------- 2 files changed, 38 deletions(-) diff --git a/backend/open_webui/routers/evaluations.py b/backend/open_webui/routers/evaluations.py index cce9d591ee..eb79bfa63c 100644 --- a/backend/open_webui/routers/evaluations.py +++ b/backend/open_webui/routers/evaluations.py @@ -10,7 +10,6 @@ from open_webui.models.feedbacks import ( FeedbackIdResponse, FeedbackListResponse, FeedbackModel, - FeedbackResponse, Feedbacks, FeedbackUserResponse, LeaderboardFeedbackData, @@ -295,12 +294,6 @@ async def get_feedback_model_ids(user=Depends(get_admin_user), db: AsyncSession return await Feedbacks.get_distinct_model_ids(db=db) -@router.get('/feedbacks/all', response_model=list[FeedbackResponse]) -async def get_all_feedbacks(user=Depends(get_admin_user), db: AsyncSession = Depends(get_async_session)): - feedbacks = await Feedbacks.get_all_feedbacks(db=db) - return feedbacks - - @router.get('/feedbacks/all/ids', response_model=list[FeedbackIdResponse]) async def get_all_feedback_ids(user=Depends(get_admin_user), db: AsyncSession = Depends(get_async_session)): return await Feedbacks.get_all_feedback_ids(db=db) diff --git a/src/lib/apis/evaluations/index.ts b/src/lib/apis/evaluations/index.ts index bfb6955bcf..3d00a61961 100644 --- a/src/lib/apis/evaluations/index.ts +++ b/src/lib/apis/evaluations/index.ts @@ -62,37 +62,6 @@ export const updateConfig = async (token: string, config: object) => { return res; }; -export const getAllFeedbacks = async (token: string = '') => { - let error = null; - - const res = await fetch(`${WEBUI_API_BASE_URL}/evaluations/feedbacks/all`, { - method: 'GET', - headers: { - Accept: 'application/json', - 'Content-Type': 'application/json', - authorization: `Bearer ${token}` - } - }) - .then(async (res) => { - if (!res.ok) throw await res.json(); - return res.json(); - }) - .then((json) => { - return json; - }) - .catch((err) => { - error = err.detail; - console.error(err); - return null; - }); - - if (error) { - throw error; - } - - return res; -}; - export const getLeaderboard = async (token: string = '', query: string = '') => { let error = null;