scuttlebutt-protocol-guide
scuttlebutt-protocol-guide copied to clipboard
Possible mistake in createHistoryStream documentation
I noticed an interesting behaviour exhibited by Patchwork. When receiving createHistoryStream
requests for sequence n
patchwork returns messages with sequence >= n
. The protocol guide seems to imply that this is incorrect and instead messages with sequence > n
should be returned.
Only return messages later than this sequence number. If not specified then start from the very beginning of the feed.
https://ssbc.github.io/scuttlebutt-protocol-guide/#createHistoryStream
Example: when Patchwork receives a createHistoryStream
request with seq
set to 10
it will start returning messages from sequence 10
. Therefore if we have an up to date feed and ask patchwork for newer messages it will always return at least one message - the least message that we have.
I wonder if this is some kind of a legacy behaviour?
Originally posted here %ptQutWwkNIIteEn791Ru27DHtOsdnbcEJRgjuxW90Y4=.sha256
.
Example session with Patchwork. I redacted some of the values.
Patchwork receives:
{
"name":["createHistoryStream"],
"type":"source",
"args":[
{
"id":"@1234=.ed25519",
"sequence":76,
"limit":100,
"keys":false
}
]
}
Patchwork replies with:
{
"previous":"%5678=.sha256",
"author":"@1234=.ed25519",
"sequence":76,
"timestamp":1648903409043,
"hash":"sha256",
"content": {...},
"signature": "..."
}
This is further corroborated by replies from certain pubs exhibiting the same behavior.