Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

com.atproto.repo.listRecords: implement reverse parameter #37

Open
tesaguri opened this issue Nov 6, 2024 · 2 comments
Open

com.atproto.repo.listRecords: implement reverse parameter #37

tesaguri opened this issue Nov 6, 2024 · 2 comments

Comments

@tesaguri
Copy link

tesaguri commented Nov 6, 2024

arroba's com.atproto.repo.listRecords seems to return the records in ascending chronological order by default:

$ curl 'https://atproto.brid.gy/xrpc/com.atproto.repo.listRecords?repo=did:plc:xbifsywyv5pka5jlknhv5yv3&collection=app.bsky.feed.post&limit=2' | jq -r '.records[] | .value.createdAt'
2024-09-02T06:39:03.174Z
2024-09-09T04:38:49.409Z

On the other hand, while the documentation of com.atproto.repo.listRecords is not clear about the expected ordering, at least the official Bluesky PDS implementation seems to return the records in descending chronological order by default:

$ curl 'https://bsky.social/xrpc/com.atproto.repo.listRecords?repo=did:plc:ewvi7nxzyoun6zhxrhs64oiz&collection=app.bsky.feed.post&limit=2' | jq '.records[] | .value.createdAt'
2024-08-09T22:00:22.312Z
2024-08-09T21:26:19.045Z

So, I guess arroba should change the default ordering to descending.

@snarfed
Copy link
Owner

snarfed commented Nov 6, 2024

Interesting find, you're digging deep!

You're right that the XRPC method doesn't seem to require a direction, and it has a reverse parameter, which would probably be more useful to implement than just changing the default direction. I'm going to take the liberty of changing this issue to track implementing that parameter. Hope you don't mind.

@snarfed snarfed changed the title Wrong ordering of records in com.atproto.repo.listRecords? com.atproto.repo.listRecords: implement reverse parameter Nov 6, 2024
@snarfed
Copy link
Owner

snarfed commented Nov 6, 2024

Oh and thanks for filing this in the right repo!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants