Closed PeterFarber closed 1 month ago
The complexity arises when Cron
is introduced, which do not have a nonce
, but exist "in between" nonces, in a way. And so a message's ordinate can be understood as "my nonce
" OR "the most recently scheduled message's nonce
". So if there are Cron results, you may need to sort by either timestamp
or something like ${ordinate}{$cron}
.
Finally, it's worth noting that the cursor received from the CU is meant to be an opaque string used by the server, and simply passed back from the client; it could be changed at the discretion of the CU impl. More broadly speaking, there isn't any guarantee that other CU impl's cursor will contain the same information. So this may work for now, but it may not when other CU implementations are eventually running as part of the network. At the very least, might necessitate a TODO
comment explaining this for posterity.
Closes #275
Overview
This PR is to address an issue with messages printing out of order in the aos cli.
Solution
The solution was to sort the
edges
returned fromgraphql
by theordinate
encoded inside of the base64 decodedcursor
. Was going to sort by thetimestamp
encoded inside thecursor
but the timestamps seem to not be a direct indicator of message order. Most likely due to the asynchronous nature of the CU?Changes
Added a single line of code to sort the edges inside the
checkLive
function inservices/connect.js
.