fix: registrar should filter the disconnected conn (#532)

* fix: registrar on disconnect only when no connections

* chore: add test
This commit is contained in:
Vasco Santos
2020-01-14 12:26:24 +01:00
committed by Jacob Heun
parent 4222c49556
commit bb2e56e6c7
3 changed files with 43 additions and 2 deletions

View File

@ -99,7 +99,7 @@ class Registrar {
let storedConn = this.connections.get(id)
if (storedConn && storedConn.length > 1) {
storedConn = storedConn.filter((conn) => conn.id === connection.id)
storedConn = storedConn.filter((conn) => conn.id !== connection.id)
this.connections.set(id, storedConn)
} else if (storedConn) {
for (const [, topology] of this.topologies) {