Files
netbird/shared/relay
Zoltán Papp 0930f0c514 [relay] Add failing regression test for per-receiver close listeners
Registers three separate receivers on the same home relay, each passing
its own onDisconnected method value, then drops the relay connection and
expects every receiver to be notified exactly once.

This FAILS on main:

    manager_test.go:558: not every listener was notified,
                         got: map[peer-a:1]

addListener deduplicates with reflect.ValueOf(callback).Pointer(). For a
method value that pointer is the address of the compiler-generated
wrapper, not an identity bound to the receiver, so all three registrations
compare equal and only the first survives. Every peer on the home relay
shares the same connectionURL key, so in production only one peer is ever
notified when the relay drops.

The test is committed red on purpose to document the defect.
2026-09-10 01:25:09 +02:00
..