fix(network): failed connects and app teardown leave client sockets and peer connections open

Aperta
#489 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
node.js, typescript
Ambito
networking

Direzione di ricerca

Start with the connect failure handling in modules/network/src/client/udp.client.network.ts and the connection lifecycle in modules/network/src/client/network-client.ts; then read modules/network/src/client/client.network.library.ts and compare its teardown with server.network.library.ts. Ensure failed connects close their transport, TCP exposes close(), and client __clear closes TCP and UDP. Done when welcome failures and application teardown leave no client transports open and late welcomes do not change the session.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug modules:network
Which package is this bug report for?

network

Issue description

On a welcome timeout or error, nothing closes the WebSocket / RTCPeerConnection created by connect(), and a late welcome still changes the session. UDPClient.close() exists but nothing calls it, and TCPClient has no close(). Core calls __clear on stop (nanoforge-application.ts:97), but the client network library has no __clear (the server library has one, server.network.library.ts:136).

Where:

Evidence:

} catch (error) {
  welcome.settle(toError(error));
}

Suggested fix: Close the transport when connect() fails, add TCPClient.close(), and add a client __clear that closes TCP and UDP.

Found during a code audit of main at be72076.

Code sample

No response

Versions
  • Engine main at be72076
  • pnpm 12.0.0, Node.js 26, Bun 1.3.14
Issue priority

Medium (should be fixed soon)

I have tested this issue on a development release

be72076

Lingua principale
TypeScript
Stelle
7
Fork
2
Merge medio
1g 17h
PR unite (30g)
17

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di NanoForge-dev/Engine

Tutte le issue di NanoForge-dev/Engine

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.