The spec says:
The identifier of a newly established stream MUST be numerically greater than all streams that the initiating endpoint has opened or reserved. This governs streams that are opened using a HEADERS frame and streams that are reserved using PUSH_PROMISE. An endpoint that receives an unexpected stream identifier MUST respond with a connection error (Section 5.4.1) of type PROTOCOL_ERROR.
For the case of the server that sends PUSH_PROMISE
it makes sense to me that conforming servers must send strictly increasing stream ids. But I don't understand how the client is supposed to detect this situation.
For example, on one connection, if the server sends:
PUSH_PROMISE
promised stream 2PUSH_PROMISE
promised stream 4
because of concurrency the client might receive
PUSH_PROMISE
promised stream 4PUSH_PROMISE
promised stream 2
the spec would have me think that client should error on this, but the server did nothing wrong.
What am I missing here?