diff --git a/internal/jsonrpc2_v2/conn.go b/internal/jsonrpc2_v2/conn.go index 7d492c402d..d60b6c5521 100644 --- a/internal/jsonrpc2_v2/conn.go +++ b/internal/jsonrpc2_v2/conn.go @@ -322,8 +322,8 @@ func (c *Connection) readIncoming(ctx context.Context, reader Reader, toQueue ch // cancelled by id if msg.IsCall() { pending := <-c.incomingBox - c.incomingBox <- pending pending[msg.ID] = entry + c.incomingBox <- pending } // send the message to the incoming queue toQueue <- entry diff --git a/internal/jsonrpc2_v2/jsonrpc2_test.go b/internal/jsonrpc2_v2/jsonrpc2_test.go index 1157779f3b..4f4b7d9b9f 100644 --- a/internal/jsonrpc2_v2/jsonrpc2_test.go +++ b/internal/jsonrpc2_v2/jsonrpc2_test.go @@ -60,6 +60,14 @@ var callTests = []invoker{ notify{"unblock", "a"}, collect{"a", true, false}, }}, + sequence{"concurrent", []invoker{ + async{"a", "fork", "a"}, + notify{"unblock", "a"}, + async{"b", "fork", "b"}, + notify{"unblock", "b"}, + collect{"a", true, false}, + collect{"b", true, false}, + }}, } type binder struct {