Chat says it's only available in a lobby while you're in one (late leave answer tears down the new lobby)

Aberta
#47 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

@Jr-JoshS já está trabalhando nisso.

Desde 31/10/2026.

  • #48 de @Jr-JoshS — aberto

Avaliação

Dificuldade
3/5
Tempo estimado
1-2 dias
Facilidade para iniciantes
25/100
Tipo de issue
Bug
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
lua
Domínio
api, networking

Direção de pesquisa

The bug is in the teardown run by lobby:leave() when the lobby_leave RPC callback arrives late. Start with the callback and the cleanup functions it calls: L.cleanup, MPAPI.chat.cleanup(), nakama_lobby.forget() and on_lobby_disconnected(). Done means a late leave answer no longer affects a lobby the player has since joined, which you can check by delaying the callback and confirming chat, match updates and the lobby page still work. Open PR #48 already targets this, so coordinate with its author before starting.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

Reported in #bugs-and-issues: "I am in a game and it shows this" — [MultiplayerAPI] Chat is only available while in a lobby.

Why: lobby:leave() tears the lobby down in the lobby_leave RPC's callback. If that answer comes after the player is already in another lobby (left and quickly created, joined or got matched into a new one), the old lobby's L.cleanup runs against the new one:

  • MPAPI.chat.cleanup() switches chat off, so typing in the new lobby shows the message above.
  • nakama_lobby.forget() drops the new lobby's match, so it stops getting lobby updates (its host never sees the next player join).
  • on_lobby_disconnected() sends the player back to the mod menu while they are still in the new lobby.

To reproduce: delay the lobby_leave callback by ~3s (a slow answer), leave a lobby and create a new one right away. Once the late answer lands: chat is off, the host doesn't see a player who joins, and the lobby page is replaced by the mod menu.

Reproduced with two clients on a local server.

Linguagem predominante
Lua
Estrelas
9
Forks
4
Merge médio
19h 50min
PRs com merge (30d)
11

Preparar o ambiente

Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de Balatro-Multiplayer/BalatroMultiplayerAPI

Todas as issues de Balatro-Multiplayer/BalatroMultiplayerAPI

Issues semelhantes

Mais issues de Lua

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.