mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-07 03:18:23 -05:00
[PR #10814] [CLOSED] chore: Improve type safety and add type hints, fix two race conditions #9396
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/10814
Author: @tidely
Created: 2/26/2025
Status: ❌ Closed
Base:
dev← Head:cleanup📝 Commits (10+)
101405fFix search results being possibly unbound3f455feBetter locals() lookupfcf213dUse logging.getLevelNamesMapping9aa144aRemove unnecessary str conversion44f063bAdd string conversion to satisfy typehints6faf744Fix error prone code1b83874Add get_from_env_or_defaultf9642b2Improve type hints for process_line1e15972Improve config.json migration46b5b67Fix type hint for user📊 Changes
5 files changed (+66 additions, -92 deletions)
View changed files
📝
backend/open_webui/config.py(+6 -8)📝
backend/open_webui/env.py(+28 -50)📝
backend/open_webui/functions.py(+9 -9)📝
backend/open_webui/retrieval/utils.py(+21 -25)📝
backend/open_webui/retrieval/web/duckduckgo.py(+2 -0)📄 Description
Changelog Entry
General code improvements
Removed two time-of-check to time-of-use (TOCTOU) race conditions.
Description
The goal of this PR is to implement stricter type checks and add type hints to improve maintainability.
These changes should have minimal functional changes. Additionally some time-of-check to time-of-use (TOCTOU) race conditions have been removed.
Fixed
time-of-check to time-of-use (TOCTOU) race conditions have been removed. These do not have open issues so I can't link any here.
Breaking Changes
This PR should have no breaking changes.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.