Constellation, Spacedust, Slingshot, UFOs: atproto crates and services for microcosm

requests with a limit sometimes return fewer than expected backlinks #11

open opened by bad-example.com

example: https://constellation.microcosm.blue/xrpc/blue.microcosm.links.getBacklinks?subject=at%3A%2F%2Fdid%3Aplc%3Arevjuqmkvrw6fnkxppqtszpv%2Fsite.standard.publication%2F3lwafzkjqm25s&source=site.standard.document%3Asite&limit=3

right now the beginning and end slicing of the backlinks happens without regard for empty slots from deleted links, so endpoints might always return fewer-than-the-limit links, even if more are available to fill up the page.

seems like this can be changed to delay processing the "end" of the list (for the cursor) until after we try to just iterate through until we've collected enough actually-present items, which will probably more closely meet what client apps expect

just to write down the counter:

clients who need an exact amount of results could implement an iterative fetch helper, which chases the cursor until it gets enough items if fewer are received.

(this doesn't really make it any easier on the current version of constellation, since the whole list gets materialized on each request anyway)

sign up or login to add to the discussion
Labels

None yet.

Participants 1
AT URI
at://did:plc:hdhoaan3xa3jiuq4fg4mefid/sh.tangled.repo.issue/3mcs36y5qsu22