Skip to content

armgit / meet

Public Imported from GitHub
0

Open source video conferencing app powered by LiveKit. Built with Django and React.

πŸ›(frontend) handle 401 responses when syncing user preferences

lebaudantoine387ae17c222c
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 418f190f..7f48fb87 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -11,6 +11,7 @@ and this project adheres to
### Fixed
- πŸ“ˆ(frontend) downgrade unreachable external home URL from error to event
+- πŸ›(frontend) handle 401 responses when syncing user preferences
## [1.26.0] - 2026-08-12
diff --git a/src/frontend/src/features/auth/api/useSyncUserPreferencesWithBackend.tsx b/src/frontend/src/features/auth/api/useSyncUserPreferencesWithBackend.tsx
index ed06e816..9e689585 100644
--- a/src/frontend/src/features/auth/api/useSyncUserPreferencesWithBackend.tsx
+++ b/src/frontend/src/features/auth/api/useSyncUserPreferencesWithBackend.tsx
@@ -6,6 +6,8 @@ import { queryClient } from '@/api/queryClient'
import { updateUserPreferences } from './updateUserPreferences'
import { convertToBackendLanguage } from '@/utils/languages'
import { useUser } from './useUser'
+import { ApiError } from '@/api/ApiError.ts'
+import { reportError } from '@/features/analytics/telemetry'
/**
* Hook that synchronizes user browser preferences (language, timezone) with backend user settings.
@@ -42,6 +44,11 @@ export const useSyncUserPreferencesWithBackend = () => {
}
}
- syncBrowserPreferencesToBackend()
+ syncBrowserPreferencesToBackend().catch((error) => {
+ if (error instanceof ApiError && error.statusCode === 401) return
+ reportError('generic_failure', error, {
+ context: '[useSyncUserPreferencesWithBackend] Failed to sync:',
+ })
+ })
}, [i18n.language, isLoggedIn, user, mutateAsync])
}