diff --git a/CHANGELOG.md b/CHANGELOG.md index 0fdcde5af..cce74f4d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.7.1] - 2026-01-09 + +### Fixed + +- ⚡ **Improved reliability for low-spec and SQLite deployments.** Fixed page timeouts by disabling database session sharing by default, improving stability for resource-constrained environments. Users can re-enable via `DATABASE_ENABLE_SESSION_SHARING=true` if needed. [#20520](https://github.com/open-webui/open-webui/issues/20520) + ## [0.7.0] - 2026-01-09 ### Added diff --git a/backend/open_webui/env.py b/backend/open_webui/env.py index d746978c2..ff48a3abf 100644 --- a/backend/open_webui/env.py +++ b/backend/open_webui/env.py @@ -341,6 +341,11 @@ if DATABASE_USER_ACTIVE_STATUS_UPDATE_INTERVAL is not None: except Exception: DATABASE_USER_ACTIVE_STATUS_UPDATE_INTERVAL = 0.0 +# When enabled, get_db_context reuses existing sessions; set to False to always create new sessions +DATABASE_ENABLE_SESSION_SHARING = ( + os.environ.get("DATABASE_ENABLE_SESSION_SHARING", "False").lower() == "true" +) + # Enable public visibility of active user count (when disabled, only admins can see it) ENABLE_PUBLIC_ACTIVE_USERS_COUNT = ( os.environ.get("ENABLE_PUBLIC_ACTIVE_USERS_COUNT", "True").lower() == "true" diff --git a/backend/open_webui/internal/db.py b/backend/open_webui/internal/db.py index ee8358659..6050e37fa 100644 --- a/backend/open_webui/internal/db.py +++ b/backend/open_webui/internal/db.py @@ -14,6 +14,7 @@ from open_webui.env import ( DATABASE_POOL_SIZE, DATABASE_POOL_TIMEOUT, DATABASE_ENABLE_SQLITE_WAL, + DATABASE_ENABLE_SESSION_SHARING, ENABLE_DB_MIGRATIONS, ) from peewee_migrate import Router @@ -164,7 +165,7 @@ get_db = contextmanager(get_session) @contextmanager def get_db_context(db: Optional[Session] = None): - if isinstance(db, Session): + if isinstance(db, Session) and DATABASE_ENABLE_SESSION_SHARING: yield db else: with get_db() as session: diff --git a/package-lock.json b/package-lock.json index 18586c839..92944a3ce 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "open-webui", - "version": "0.7.0", + "version": "0.7.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "open-webui", - "version": "0.7.0", + "version": "0.7.1", "dependencies": { "@azure/msal-browser": "^4.5.0", "@codemirror/lang-javascript": "^6.2.2", diff --git a/package.json b/package.json index c4a4c56bf..5729bccf0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "open-webui", - "version": "0.7.0", + "version": "0.7.1", "private": true, "scripts": { "dev": "npm run pyodide:fetch && vite dev --host",