Skip to content

armgit / meet

Public Imported from GitHub
0

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

🐛(frontend) show a page when the connection ends unexpectedly

briquetf7c3f392ef85
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6cd5b54b..8cb8afbe 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -12,6 +12,10 @@ and this project adheres to
- ⬆️(frontend) upgrade livekit-client to 2.23.0
+### Fixed
+
+- 🐛(frontend) show a page when the connection ends unexpectedly
+
## [1.37.0] - 2026-11-01
### Changed
diff --git a/src/frontend/src/features/rooms/components/Conference.tsx b/src/frontend/src/features/rooms/components/Conference.tsx
index 5389bf0b..b67bee75 100644
--- a/src/frontend/src/features/rooms/components/Conference.tsx
+++ b/src/frontend/src/features/rooms/components/Conference.tsx
@@ -46,6 +46,7 @@ import { WatchMediaDeviceErrors } from './WatchMediaDeviceErrors'
import { MeetDevtools } from '@/features/devtools'
import { VOICE_AUDIO_CONSTRAINTS } from '@/features/rooms/livekit/utils/constants'
import { resolveAudioOutputDeviceId } from '@/features/rooms/utils/resolveAudioOutputDeviceId'
+import { ConnectionEndReason } from '@/features/rooms/utils/connectionEndReason'
export const Conference = ({
roomId,
@@ -186,6 +187,7 @@ export const Conference = ({
const isMobile = useIsMobile()
const hasAutoMutedRef = useRef(false)
+ const hasConnectedRef = useRef(false)
/*
* Ensure stable WebSocket connection URL. This is critical for legacy browser compatibility
@@ -266,6 +268,7 @@ export const Conference = ({
})
}}
onConnected={async () => {
+ hasConnectedRef.current = true
if (!apiConfig) return
if (
userPreferencesSnap.is_auto_mute_large_room_enabled &&
@@ -307,6 +310,20 @@ export const Conference = ({
}
)
return
+ default:
+ // Reconnecting gave up, or the join itself failed
+ navigateTo(
+ 'feedback',
+ {},
+ {
+ state: {
+ reason: hasConnectedRef.current
+ ? ConnectionEndReason.Lost
+ : ConnectionEndReason.Failed,
+ ...metadata,
+ },
+ }
+ )
}
}}
>
diff --git a/src/frontend/src/features/rooms/livekit/components/ConnectionObserver.tsx b/src/frontend/src/features/rooms/livekit/components/ConnectionObserver.tsx
index 9eea1da0..d45f631b 100644
--- a/src/frontend/src/features/rooms/livekit/components/ConnectionObserver.tsx
+++ b/src/frontend/src/features/rooms/livekit/components/ConnectionObserver.tsx
@@ -1,12 +1,13 @@
import { useConfig } from '@/api/useConfig'
import { useIsAnalyticsEnabled } from '@/features/analytics/hooks/useIsAnalyticsEnabled'
import {
+ useConnectionState,
useRemoteParticipants,
useRoomContext,
} from '@livekit/components-react'
import { useEffect, useRef } from 'react'
import { useSnapshot } from 'valtio'
-import { DisconnectReason, RoomEvent } from 'livekit-client'
+import { ConnectionState, DisconnectReason, RoomEvent } from 'livekit-client'
import { userPreferencesStore } from '@/stores/userPreferences'
@@ -31,6 +32,7 @@ export const ConnectionObserver = () => {
RoomEvent.ParticipantDisconnected,
],
})
+ const connectionState = useConnectionState(room)
useEffect(() => {
// Always clear existing timer on dependency change
@@ -48,6 +50,10 @@ export const ConnectionObserver = () => {
return
}
+ // A full reconnection removes every remote participant until it
+ // succeeds: being alone then doesn't mean being idle
+ if (connectionState !== ConnectionState.Connected) return
+
if (remoteParticipants.length === 0) {
idleDisconnectModalTimeoutRef.current = setTimeout(() => {
connectionObserverStore.isIdleDisconnectModalOpen = true
@@ -64,6 +70,7 @@ export const ConnectionObserver = () => {
}
}, [
remoteParticipants.length,
+ connectionState,
data?.idle_disconnect_warning_delay,
userPreferencesSnap.is_idle_disconnect_modal_enabled,
])
diff --git a/src/frontend/src/features/rooms/routes/Feedback.tsx b/src/frontend/src/features/rooms/routes/Feedback.tsx
index 1107694a..f2514aeb 100644
--- a/src/frontend/src/features/rooms/routes/Feedback.tsx
+++ b/src/frontend/src/features/rooms/routes/Feedback.tsx
@@ -7,6 +7,7 @@ import { Rating } from '@/features/rooms/components/Rating.tsx'
import { useLocation } from 'wouter'
import { useMemo } from 'react'
import { DisconnectReason } from 'livekit-client'
+import { ConnectionEndReason } from '@/features/rooms/utils/connectionEndReason'
// fixme - duplicated with home, refactor in a proper style
const Heading = styled('h1', {
@@ -32,6 +33,8 @@ enum DisconnectReasonKey {
DuplicateIdentity = 'duplicateIdentity',
ParticipantRemoved = 'participantRemoved',
RoomDeleted = 'roomDeleted',
+ ConnectionLost = 'connectionLost',
+ ConnectionFailed = 'connectionFailed',
}
const FeedbackRoute = () => {
@@ -49,6 +52,10 @@ const FeedbackRoute = () => {
return DisconnectReasonKey.ParticipantRemoved
case DisconnectReason.ROOM_DELETED:
return DisconnectReasonKey.RoomDeleted
+ case ConnectionEndReason.Lost:
+ return DisconnectReasonKey.ConnectionLost
+ case ConnectionEndReason.Failed:
+ return DisconnectReasonKey.ConnectionFailed
}
}, [])
@@ -91,7 +98,9 @@ const FeedbackRoute = () => {
{t('feedback.home')}
</Button>
</Stack>
- <Rating metadata={metadata} />
+ {reasonKey !== DisconnectReasonKey.ConnectionFailed && (
+ <Rating metadata={metadata} />
+ )}
</VStack>
</Center>
</Screen>
diff --git a/src/frontend/src/features/rooms/utils/connectionEndReason.ts b/src/frontend/src/features/rooms/utils/connectionEndReason.ts
new file mode 100644
index 00000000..d8826ee0
--- /dev/null
+++ b/src/frontend/src/features/rooms/utils/connectionEndReason.ts
@@ -0,0 +1,7 @@
+/**
+ * Why a room ended when no more specific reason applies
+ */
+export enum ConnectionEndReason {
+ Failed = 'connectionFailed',
+ Lost = 'connectionLost',
+}
diff --git a/src/frontend/src/locales/de/rooms.json b/src/frontend/src/locales/de/rooms.json
index ac58d0e6..e4bb74c2 100644
--- a/src/frontend/src/locales/de/rooms.json
+++ b/src/frontend/src/locales/de/rooms.json
@@ -4,7 +4,9 @@
"normal": "Du hast das Meeting verlassen",
"duplicateIdentity": "Du bist dem Meeting von einem anderen Gerät aus beigetreten",
"participantRemoved": "Du wurdest vom Host aus dem Meeting entfernt",
- "roomDeleted": "Dieses Meeting wurde gelöscht"
+ "roomDeleted": "Dieses Meeting wurde gelöscht",
+ "connectionLost": "Die Verbindung zum Meeting wurde unterbrochen",
+ "connectionFailed": "Beitritt zum Meeting nicht möglich"
},
"home": "Zur Startseite zurückkehren",
"back": "Dem Meeting erneut beitreten"
diff --git a/src/frontend/src/locales/en/rooms.json b/src/frontend/src/locales/en/rooms.json
index 472d60ed..48a72dbd 100644
--- a/src/frontend/src/locales/en/rooms.json
+++ b/src/frontend/src/locales/en/rooms.json
@@ -4,7 +4,9 @@
"normal": "You have left the meeting",
"duplicateIdentity": "You have joined the meeting from another device",
"participantRemoved": "You have been removed from the meeting by a host",
- "roomDeleted": "This meeting has been deleted"
+ "roomDeleted": "This meeting has been deleted",
+ "connectionLost": "The connection to the meeting was lost",
+ "connectionFailed": "Unable to join the meeting"
},
"home": "Return to home",
"back": "Rejoin the meeting"
diff --git a/src/frontend/src/locales/es/rooms.json b/src/frontend/src/locales/es/rooms.json
index bf3f33a8..4c2bcadb 100644
--- a/src/frontend/src/locales/es/rooms.json
+++ b/src/frontend/src/locales/es/rooms.json
@@ -4,7 +4,9 @@
"normal": "Has salido de la reunión",
"duplicateIdentity": "Te has unido a la reunión desde otro dispositivo",
"participantRemoved": "Un administrador te ha expulsado de la llamada",
- "roomDeleted": "Esta reunión ha sido eliminada"
+ "roomDeleted": "Esta reunión ha sido eliminada",
+ "connectionLost": "Se ha perdido la conexión con la reunión",
+ "connectionFailed": "No se ha podido acceder a la reunión"
},
"home": "Volver al inicio",
"back": "Volver a la reunión"
diff --git a/src/frontend/src/locales/fr/rooms.json b/src/frontend/src/locales/fr/rooms.json
index db4ae0e3..807aff2f 100644
--- a/src/frontend/src/locales/fr/rooms.json
+++ b/src/frontend/src/locales/fr/rooms.json
@@ -4,7 +4,9 @@
"normal": "Vous avez quitté la réunion",
"duplicateIdentity": "Vous avez rejoint la réunion depuis un autre appareil",
"participantRemoved": "Vous avez été exclu de l'appel par un administrateur",
- "roomDeleted": "Cette réunion a été supprimée"
+ "roomDeleted": "Cette réunion a été supprimée",
+ "connectionLost": "La connexion à la réunion a été perdue",
+ "connectionFailed": "Impossible de rejoindre la réunion"
},
"home": "Retourner à l'accueil",
"back": "Réintégrer la réunion"
diff --git a/src/frontend/src/locales/nl/rooms.json b/src/frontend/src/locales/nl/rooms.json
index d343a217..2fca2d20 100644
--- a/src/frontend/src/locales/nl/rooms.json
+++ b/src/frontend/src/locales/nl/rooms.json
@@ -4,7 +4,9 @@
"normal": "Je hebt de vergadering verlaten",
"duplicateIdentity": "U heeft de vergadering via een ander apparaat geopend",
"participantRemoved": "U bent door een beheerder uit het gesprek verwijderd",
- "roomDeleted": "Deze vergadering is verwijderd"
+ "roomDeleted": "Deze vergadering is verwijderd",
+ "connectionLost": "De verbinding met de vergadering is verbroken",
+ "connectionFailed": "Deelnemen aan de vergadering is niet gelukt"
},
"home": "Keer terug naar het hoofdscherm",
"back": "Sluit weer bij de vergadering aan"