mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-15 21:19:39 -05:00
[PR #23794] [MERGED] perf(users): drop redundant get_user_by_id refetch in session-user endpoints #27369
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/23794
Author: @Classic298
Created: 4/16/2026
Status: ✅ Merged
Merged: 4/17/2026
Merged by: @tjbck
Base:
dev← Head:claude/remove-user-double-fetch📝 Commits (3)
35ca09fperf(users): drop redundant get_user_by_id refetch in session-user endpoints921658dfix(users): preserve USER_NOT_FOUND error on status update failure32aa70fdocs(users): note lost-update tradeoff on /user/info/update📊 Changes
1 file changed (+21 additions, -46 deletions)
View changed files
📝
backend/open_webui/routers/users.py(+21 -46)📄 Description
Five /user/* handlers refetched the user row via Users.get_user_by_id(user.id) immediately after receiving an identical UserModel from Depends(get_verified_user). Since get_verified_user already populated the user within the same request microseconds earlier, the refetch is pure overhead. The dead else branches (unreachable — get_verified_user raises 401 on missing user) are removed as a natural consequence.
Affected endpoints:
Eliminates one SELECT per request to each of these endpoints with no behavioral change.
Contributor License Agreement
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.