🩹(frontend) fix reconnect loop caused by connectionObserverStore updates

Updating connectionObserverSnapshot triggered page re-renders,
causing participants to reconnect due to a race condition.

Read directly from the underlying store instead of using the
snapshot to avoid unnecessary re-renders.
This commit is contained in:
lebaudantoine
2026-04-30 16:38:05 +02:00
committed by aleb_the_flash
parent ac2eddc10f
commit dd3d47afe6
2 changed files with 7 additions and 9 deletions
+1
View File
@@ -23,6 +23,7 @@ and this project adheres to
- ⬆️(backend) bump django-lasuite to v0.0.26
- 🩹(frontend) use a more standard (quality) rating scale
- 🩹(frontend) fix access control for screen recording feature flag
- 🩹(frontend) fix reconnect loop caused by connectionObserverStore updates
## [1.14.0] - 2026-04-16
@@ -31,7 +31,6 @@ import { useConfig } from '@/api/useConfig'
import { isFireFox } from '@/utils/livekit'
import { useIsMobile } from '@/utils/useIsMobile'
import { navigateTo } from '@/navigation/navigateTo'
import { useSnapshot } from 'valtio'
import { connectionObserverStore } from '@/stores/connectionObserver'
export const Conference = ({
@@ -46,8 +45,6 @@ export const Conference = ({
const posthog = usePostHog()
const { data: apiConfig } = useConfig()
const connectionObserverSnap = useSnapshot(connectionObserverStore)
const { userChoices: userConfig } = usePersistentUserChoices() as {
userChoices: LocalUserChoices
}
@@ -234,16 +231,16 @@ export const Conference = ({
onDisconnected={(e) => {
const metadata = {
room_id: roomId,
pc_publisher: connectionObserverSnap.publisher && {
...connectionObserverSnap.publisher,
pc_publisher: connectionObserverStore.publisher && {
...connectionObserverStore.publisher,
},
pc_subscriber: connectionObserverSnap.subscriber && {
...connectionObserverSnap.subscriber,
pc_subscriber: connectionObserverStore.subscriber && {
...connectionObserverStore.subscriber,
},
pc_publisher_changes_count:
connectionObserverSnap.publisherChangesCount,
connectionObserverStore.publisherChangesCount,
pc_subscriber_changes_count:
connectionObserverSnap.subscriberChangesCount,
connectionObserverStore.subscriberChangesCount,
}
connectionObserverStore.publisher = null