diff --git a/backend/open_webui/main.py b/backend/open_webui/main.py index ea6babd59..e3e3cde4d 100644 --- a/backend/open_webui/main.py +++ b/backend/open_webui/main.py @@ -933,7 +933,7 @@ async def get_app_config(request: Request): "enable_api_key": app.state.config.ENABLE_API_KEY, "enable_signup": app.state.config.ENABLE_SIGNUP, "enable_login_form": app.state.config.ENABLE_LOGIN_FORM, - "disable_websocket_polling": ENABLE_WEBSOCKET_SUPPORT, + "enable_websocket": ENABLE_WEBSOCKET_SUPPORT, **( { "enable_web_search": app.state.config.ENABLE_RAG_WEB_SEARCH, diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 71ee2dc8b..d92e8c2ab 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -38,15 +38,14 @@ let loaded = false; const BREAKPOINT = 768; - const setupSocket = (disableWebSocketPolling) => { - console.log('Disabled websocket polling', disableWebSocketPolling); + const setupSocket = (enableWebsocket) => { const _socket = io(`${WEBUI_BASE_URL}` || undefined, { reconnection: true, reconnectionDelay: 1000, reconnectionDelayMax: 5000, randomizationFactor: 0.5, path: '/ws/socket.io', - transports: disableWebSocketPolling ? ['websocket'] : ['polling', 'websocket'], + transports: enableWebsocket ? ['websocket'] : ['polling', 'websocket'], auth: { token: localStorage.token } }); @@ -127,9 +126,8 @@ await config.set(backendConfig); await WEBUI_NAME.set(backendConfig.name); - const disableWebSocketPolling = backendConfig.features.disable_websocket_polling === true; if ($config) { - setupSocket(disableWebSocketPolling); + setupSocket($config.features?.enable_websocket ?? true); if (localStorage.token) { // Get Session User Info