What happened
Nim is receiving a {WindowUpdate, {}, streamId: 1, length: 127} after it has received a {WindowUpdate, {Fin}, streamId: 1, length: 0}. Nim sent {Data, {Fin}, streamId: 1, length: 0} before receiving the messages above, so it believes the stream has been fully closed from both sides and doesn't accept the last WindowUpdate. It is possible that JS still hasn't received the Nim close msg. The Yamux spec says "To close a stream, either side sends a data or window update frame along with the FIN flag. This does a half-close indicating the sender will send no further data.". Does it include WindowUpdate?
Copy of issue from the js-libp2p repo: https://github.com/libp2p/js-libp2p/issues/2505
Description:
What you did The ping test sometimes fails when js is the dialer and nim-libp2p the listener. https://github.com/vacp2p/nim-libp2p/actions/runs/8815571518/job/24199161935?pr=1086
What happened Nim is receiving a {WindowUpdate, {}, streamId: 1, length: 127} after it has received a {WindowUpdate, {Fin}, streamId: 1, length: 0}. Nim sent {Data, {Fin}, streamId: 1, length: 0} before receiving the messages above, so it believes the stream has been fully closed from both sides and doesn't accept the last WindowUpdate. It is possible that JS still hasn't received the Nim close msg. The Yamux spec says "To close a stream, either side sends a data or window update frame along with the FIN flag. This does a half-close indicating the sender will send no further data.". Does it include WindowUpdate?
These are the logs filtered by streamId: 1: