go-ssb icon indicating copy to clipboard operation
go-ssb copied to clipboard

getSubset: --desc flag does not always return messages

Open mycognosist opened this issue 2 years ago • 0 comments

Problem

Subset type query does not return messages when descending is true.

Build

Both go-sbot and sbotcli built from the sbotcli-getsubset branch.

Examples

Returns two post type messages in ascending order, as expected:

./sbotcli subset --limit 2 '{"op":"type", "string": "post"}'

raw args: [{"op":"type","string":"post"},{"keys":false,"pageLimit":2}]

Returns nothing (anomalous behaviour):

./sbotcli subset --limit 2 --desc '{"op":"type", "string": "post"}'

raw args: [{"op":"type","string":"post"},{"keys":false,"descending":true,"pageLimit":2}]

Returns the first contact type message by the specified author, as expected:

./sbotcli subset --limit 1 '{"op":"and","args":[{"op":"author","feed":"@HEqy940T6uB+T+d9Jaa58aNfRzLx9eRWqkZljBmnkmk=.ed25519"},{"op":"type","string":"contact"}]}'

Returns the latest contact type message by the specified author, as expected:

./sbotcli subset --limit 1 --desc '{"op":"and","args":[{"op":"author","feed":"@HEqy940T6uB+T+d9Jaa58aNfRzLx9eRWqkZljBmnkmk=.ed25519"},{"op":"type","string":"contact"}]}'


The type query is the only one I've found with this behaviour. I just tried the author query with --desc and without and both returned messages successfully. I have confirmed this behaviour using golgi+kuska.

mycognosist avatar Jan 11 '22 09:01 mycognosist