Repository navigation
Listeners del socket que sobreviven a la recarga - #12
Merged
Merged
Conversation
socketService.on no hacía nada si el socket todavía no existía. Al abrir o recargar una página, sus efectos corren antes de que el SocketProvider conecte, así que en producción (sin el doble montaje de StrictMode) esos listeners se perdían. Por ejemplo: 'Crear mesa' quedaba deshabilitado al entrar directo a /lobbies, y al recargar en plena partida no se volvía a la mesa. Ahora el servicio guarda los listeners y los engancha al crear el socket. Co-Authored-By: Claude <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
socketService.onno hacía nada si el socket todavía no existía. Al abrir o recargar una página, los efectos de la página corren antes de que elSocketProvidercree la conexión, así que esos listeners se perdían. En desarrollo no se notaba porque StrictMode monta todo dos veces.Lo que se veía en producción:
/lobbies(o recargarla), "Crear mesa" quedaba deshabilitado para siempre.Ahora el servicio guarda los listeners y los engancha cuando crea el socket. El arreglo está en un solo lugar y cubre
useSocket,useGameyuseTruco.Pruebas
Sobre el build de producción (
vite build+vite preview) contra el server local:/lobbiesse cuelga con el botón deshabilitado (reproducido).tscy build OK; el lint pasa de 15 a 14 errores.🤖 Generated with Claude Code