Background: the database function might not return these in the correct order, as the ids will almost, but not always be in the right order.
This also partially addresses thread ordering in the Mastodon client API.