add clarity to ID lifetime, mutual "complete" and unknown IDs #340
Replies: 2 comments 6 replies
-
Hey hey, I am sorry for the late replay, haven't had time to read into this with care.
The Protocol makes no assumptions in this regard, so yes. Thanks for the elaborate explanation and great thinking, I agree with you - let's see if we're in line over at #342. |
Beta Was this translation helpful? Give feedback.
-
Thank you for this clarification to the protocol. However, I still have a question about whether the protocol places any constraints on how to handle Does a At the start of the protocol document, it says that the |
Beta Was this translation helpful? Give feedback.
-
The protocol specification specifies what to do when a
subscribe
message arrives with anid
corresponding to an active operation. However, it doesn't say whether it needs to keep track of already completed operations.Is it permissible to re-use an ID on a connection if it has been previously completed by the server?
Similarly, it doesn't specify what should happen when a
next
orcomplete
message is seen with an unknown (or already completed) ID.This is important because of the inherently racy nature of the
complete
message. Both client and server can issue acomplete
message when the other party has already done the same, and the message is in flight.complete
, anerror
,next
or acomplete
message may be underway from the server.complete
, the client may have already issued acomplete
and it is somewhere in-flight.In my opinion the protocol spec should be augmented with the following:
error
orcomplete
message.complete
messages and how sending acomplete
message cannot guarantee that a message (error
,next
,complete
) can yet be received after sending it.Furthermore, single-result-operations can be more easily explained protocol-wise of being just special cases of subscriptions, where there will be one, and only one,
next
message (unless it is preceded by anerror
message`.The reason I am suggesting this is that I am in the process of writing a client implementation against a server implementation which violates 3. above, i.e. it will cause a disconnect when two
complete
messages race. Having specific guidelines in the protocol would help implementors to avoid such mistakes.Any thoughts?
Beta Was this translation helpful? Give feedback.
All reactions