Websockets fails when redirect happens
Closed this issue · 1 comments
andresgutgon commented
What?
when you enter a project we do a redirect to the proper commit version. In the meantime the socket tries to connect but it fails
Posible fix.
Do a delay of 200ms before start connecting.
Here
https://github.com/latitude-dev/latitude-llm/blob/main/apps/web/src/components/Providers/WebsocketsProvider/index.tsx#L42
import { IoProvider, useSocket } from 'socket.io-react-hook'
const enabled = useRef(false)
useEffect(() => {
const timeout = setTimeout(() => {
enabled.current = true
}, 200)
}, [])
return useSocket(namespace, {
enabled: enabled.current,
// Other config
})
Something like this
Sentry issue
andresgutgon commented
Last error in that sentry list is from beginning of oct. Resolving this one