Closed hannahhoward closed 2 years ago
I honestly don't know what we should do with the undefeined behavior for old messages where cancel + update are both true -- maybe just drop the message entirely?
The current behaviour just lets them through: https://github.com/ipfs/go-graphsync/blob/e8cdcb24c0bac2cb343de1e63e5792b99b0a0611/message/message.go#L165 but then deals them in priority order: cancel, then update, then assumes new https://github.com/ipfs/go-graphsync/blob/e8cdcb24c0bac2cb343de1e63e5792b99b0a0611/responsemanager/server.go#L186-L193
In the v2 work I've already pushed this same logic down into message decoding so it short-circuits when it finds cancel and update messages: https://github.com/ipfs/go-graphsync/blob/21a4546cdfd2e53d132c4015c24c487e166c9103/message/v1/message.go#L180-L209
But that does leave a hole in the cancel=true & update=true case, in both the current release and next release they'd just be treated as a cancel. We could drop them, but I'm not sure we gain much by closing that gap? Easy to do so if you reckon it's worth it.
Goals
Right now, a graphsync request has two bools -- cancel & update. Really, it has three modes:
In the new protocol, it should be a single request type, especially since we may want to add more (in the future
Implementation
I put restart in as an example but it's left out intentionally for implementing first version
Hopefully the conversion is fairly clear based on the table above. I honestly don't know what we should do with the undefeined behavior for old messages where cancel + update are both true -- maybe just drop the message entirely? I have no idea what we're doing now but no implementation of graphsync should be doing this.