Hmm, I wonder how this would then work with the path_to_other parameter. Currently we have this nested grouping in order to show and disambiguate different relationships between different links.
For instance take the following query and it's results:
http://localhost:6789/xrpc/blue.microcosm.links.getManyToMany?subject=at://did:plc:2w45zyhuklwihpdc7oj3mi63/app.bsky.feed.post/3mdbbkuq6t32y&source=app.bsky.feed.post:reply.root.uri&pathToOther=reply.parent.uri&limit=16
This query asks: "Show me all posts in this thread, grouped by who they're responding to."
A flat list would just give us all the posts in the thread. The nested structure answers a richer question: who's talking to whom? Some posts are direct responses to the original article. Others are replies to other commenters, forming side conversations that branch off from the main thread.
The pathToOther grouping preserves that distinction. Without it, we'd lose the information about who's talking to whom.
{
"linking_records": [
{
"subject": "at://did:plc:2w45zyhuklwihpdc7oj3mi63/app.bsky.feed.post/3mdbbkuq6t32y",
"records": [
{
"did": "did:plc:lznqwrsbnyf6fdxohikqj6h3",
"collection": "app.bsky.feed.post",
"rkey": "3mdd27pja7s2y"
},
{
"did": "did:plc:uffx77au6hoauuuumkbuvqdr",
"collection": "app.bsky.feed.post",
"rkey": "3mdd2tt5efc2a"
},
{
"did": "did:plc:y7qyxzo7dns5m54dlq3youu3",
"collection": "app.bsky.feed.post",
"rkey": "3mdd2wtjxgc2d"
},
{
"did": "did:plc:yaakslxyqydb76ybgkhrr4jk",
"collection": "app.bsky.feed.post",
"rkey": "3mdd35hyads22"
},
{
"did": "did:plc:fia7w2kbnrdjwp6zvxywt7qv",
"collection": "app.bsky.feed.post",
"rkey": "3mdd37j3ldk2m"
},
{
"did": "did:plc:xtecipifublblkomwau5x2ok",
"collection": "app.bsky.feed.post",
"rkey": "3mdd3dbtbz22n"
},
{
"did": "did:plc:hl5lhiy2qr4nf5e4eefldvme",
"collection": "app.bsky.feed.post",
"rkey": "3mdd42hpw7c2e"
},
{
"did": "did:plc:fgquypfh32pewivn3bcmzseb",
"collection": "app.bsky.feed.post",
"rkey": "3mdd46jteoc2m"
}
]
},
{
"subject": "at://did:plc:3rhjxwwui6wwfokh4at3q2dl/app.bsky.feed.post/3mdczc7c4gk2i",
"records": [
{
"did": "did:plc:3rhjxwwui6wwfokh4at3q2dl",
"collection": "app.bsky.feed.post",
"rkey": "3mdczt7cwhk2i"
}
]
},
{
"subject": "at://did:plc:6buibzhkqr4vkqu75ezr2uv2/app.bsky.feed.post/3mdby25hbbk2v",
"records": [
{
"did": "did:plc:fgeie2bmzlmx37iglj3xbzuj",
"collection": "app.bsky.feed.post",
"rkey": "3mdd26ulf4k2j"
}
]
},
{
"subject": "at://did:plc:lwgvv5oqh5stzb6dxa5d7z3n/app.bsky.feed.post/3mdcxqbkkfk2i",
"records": [
{
"did": "did:plc:hl5lhiy2qr4nf5e4eefldvme",
"collection": "app.bsky.feed.post",
"rkey": "3mdd45u56sk2e"
}
]
}
],
"cursor": null
}
Correct me if I'm somehow wrong here!
Regarding returning at-uris: I think this might be a nice idea as users might be able to split these up when they feel the need to any way and it feels conceptually more complete. But, it might be easier to do this in a different PR over all existing XRPC endpoints. This would allow us to add this new endpoint already while working on the updated return values in the meantime. I'd like to avoid doing too much distinct stuff in one PR. 😃