From 789254395d007054a498fd779c6b198cb0748bcd Mon Sep 17 00:00:00 2001 From: vmikhalevskii Date: Tue, 15 Sep 2026 17:30:55 +0300 Subject: [PATCH 1/2] feat: add api version to Sentry --- .../api-client/src/utils/capture-api-error.ts | 15 --------------- .../api/src/lib/app-configuration/api.ts | 9 ++++++++- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/libs/shared/data-access/api-client/src/utils/capture-api-error.ts b/libs/shared/data-access/api-client/src/utils/capture-api-error.ts index e069dc3b..27b0aaca 100644 --- a/libs/shared/data-access/api-client/src/utils/capture-api-error.ts +++ b/libs/shared/data-access/api-client/src/utils/capture-api-error.ts @@ -1,6 +1,5 @@ import * as Sentry from '@sentry/react-native'; import { AxiosError, isAxiosError } from 'axios'; -import { queryClient } from '@open-webui-react-native/shared/data-access/query-client'; import { stripOrigin } from '@open-webui-react-native/shared/utils/strings'; import { ApiErrorData } from '../types'; @@ -94,22 +93,12 @@ const getRequestUrl = (error: AxiosError): string | undefined => { return url; }; -const getApiInstanceMeta = (): { apiVersion?: string } => { - const configuration = queryClient.getQueryData<{ version?: string }>(['config']); - - return { - apiVersion: configuration?.version, - }; -}; - export type CaptureApiErrorParams = { operation: string; context?: Record; }; export const captureApiError = (error: unknown, { operation, context = {} }: CaptureApiErrorParams): void => { - const { apiVersion } = getApiInstanceMeta(); - if (isAxiosError(error)) { const axiosError = error as AxiosError; const { config, response } = axiosError; @@ -119,11 +108,9 @@ export const captureApiError = (error: unknown, { operation, context = {} }: Cap scope.setTag('api.operation', operation); scope.setTag('http.status_code', String(status ?? 'unknown')); scope.setTag('http.method', config?.method ?? 'unknown'); - scope.setTag('api.version', apiVersion ?? 'unknown'); scope.setLevel('error'); scope.setContext('api', { - apiVersion, url: getRequestUrl(axiosError), method: config?.method, status, @@ -145,8 +132,6 @@ export const captureApiError = (error: unknown, { operation, context = {} }: Cap Sentry.withScope((scope) => { scope.setTag('api.operation', operation); - scope.setTag('api.version', apiVersion ?? 'unknown'); - scope.setContext('api', { apiVersion }); scope.setContext('api_request', sanitizeContextForSentry(context)); Sentry.captureException(error); }); diff --git a/libs/shared/data-access/api/src/lib/app-configuration/api.ts b/libs/shared/data-access/api/src/lib/app-configuration/api.ts index 60bc3ce3..23953921 100644 --- a/libs/shared/data-access/api/src/lib/app-configuration/api.ts +++ b/libs/shared/data-access/api/src/lib/app-configuration/api.ts @@ -1,6 +1,7 @@ +import * as Sentry from '@sentry/react-native'; import { useQuery, UseQueryOptions, UseQueryResult } from '@tanstack/react-query'; import { AxiosError } from 'axios'; -import { useState } from 'react'; +import { useEffect, useState } from 'react'; import { refetchOnMountWithStaleCheck } from '@open-webui-react-native/shared/data-access/persist-query-helpers'; import { queryClient } from '@open-webui-react-native/shared/data-access/query-client'; import { appConfigurationApiConfig } from './config'; @@ -56,6 +57,12 @@ export function useGetAppConfiguration( } }; + useEffect(() => { + if (result.isSuccess) { + Sentry.setTag('api.version', result.data?.version); + } + }, [result.isSuccess, result.data?.version]); + return { ...result, fetchWithUrlResult, From c96215b6b68fa84feb7821e50bcfd6373bddc476 Mon Sep 17 00:00:00 2001 From: vmikhalevskii Date: Tue, 15 Sep 2026 18:38:32 +0300 Subject: [PATCH 2/2] docs: mention Open WebUI server version tag in privacy policy --- PRIVACY_POLICY.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PRIVACY_POLICY.md b/PRIVACY_POLICY.md index 240a427e..f7f70fc1 100644 --- a/PRIVACY_POLICY.md +++ b/PRIVACY_POLICY.md @@ -34,6 +34,8 @@ The App uses Sentry to track crashes and application errors so we can diagnose a When an error occurs, Sentry receives the error/crash message and stack trace, along with diagnostic details about failed requests to your Open WebUI server: the HTTP status and method, the request path (the server’s domain/host is stripped and never sent), and the request/response body. Body content is length-truncated, and any fields that may contain conversation text (such as content, message, text, or prompt) are redacted before being sent. +Every Sentry report includes the version number your Open WebUI server reports for itself. It is updated whenever the App loads the server configuration, including when you switch servers. + We do not send your chat content, AI prompts or responses, or your Open WebUI server’s address/domain to Sentry. ## Google Sign-In (Optional)