mirror of
https://github.com/netbirdio/netbird.git
synced 2026-05-20 15:49:55 +00:00
Two real bugs in the WASM WebTransport conn that would only show up under conn teardown: - awaitPromise released its js.Func callbacks on ctx cancellation, so a pending datagram read/write promise that later settled (closing the WebTransport rejects every in-flight promise) tried to invoke a released Go function and crashed the WASM module. The callbacks now release themselves exactly once from inside the settlement path; ctx cancellation only releases the Go-side waiter. - Read and Write returned ErrClosedByServer on transport errors but didn't mark the conn closed, so the relay client's next Read could block on a fresh reader.read() promise instead of short-circuiting. Both paths now call markClosed before returning the error.