Looks like we might need a rebase, seems like this picked up (and is trying to undo) the changes from your other two PRs
I think merging upstream into the fork might work as well and makes things easier for you as the reviewer. I don't mind rebasing ofc.
i think we double-reverse for reverse-order backlinks:
Yeah the existing .rev() calls were a bit confusing at first. Maybe changing the default order to return the oldest links per default might make things a bit clearer? Though I think this is mostly helping us as the maintainers as users might expect to get served the newest ones most of the time.
Another option could be introducing an "order" query parameter with two possible values asc and desc (or something similar) to make things a bit more clear what the default order is, but then we would lose the consistency between our endpoint and com.atproto.repo.listRecords.
We could reduce the number of times we reverse using the following I think:
let mut did_id_rkeys = linkers.0[begin..end].iter().collect::<Vec<_>>();
if !reverse {
did_id_rkeys.reverse();
}
Some comments might be justified though. That conditional looks super confusing lol