ozone: serve post versions and reported versions (APP-4017) by mozzius · Pull Request #6033 · bluesky-social/atproto
Commentaire de pull request · PR #6033 ozone: serve post versions and reported versions (APP-4017) · @github-actions I found nothing that should block this PR. CI was still running when I reviewed it, so I couldn't confirm the type-check or tests.
What I checked
fetchPostVersion fallback ( packages/ozone/src/mod-service/views.ts:422 ): it only runs when the AppView's getRecord returns RecordNotFound and the request is for an app.bsky.feed.post with a cid . In every other case it returns null , so the existing PDS fallback works as before. That includes the AppView not implementing the method yet, a NotFound , and a CID that isn't one of the post's versions.
When no CID is given, the result is the same as before.
An unknown CID still ends in RecordNotFound , which the new test covers.
Extra AppView requests: fetchRecords now makes at most one more call per subject, and only for post subjects that carry a CID and that the AppView reported missing. That's bounded by the number of subjects, so there's no new fan-out.
Proxied app.bsky.feed.getPostVersions ( packages/ozone/src/api/proxied.ts:82 ): it uses the same modOrAdminToken auth and appviewAuth pattern as the existing getPostThread proxy.
On the AppView side, standardReadOrRoleOptional → parseCreds → includeTakedowns decides whether taken-down versions show up, the same as for the thread proxy.
Lexicons: only the vendored app.bsky.* lexicons change ( editedAt , viewCount , interactionFollow , interactionUnspecced , viewContext , payload ), and every change adds something.
Ozone only passes these fields through.
Nothing under the root lexicons/ ( com.atproto / tools.ozone ) is touched.
Types: postView.record and getRecord 's value are both unknown in the lexicons, so mapping version.record to value should type-check.
Changeset: a patch for @atproto/ozone fits, since this adds behaviour inside a service package and changes no public library API.
Test ( packages/ozone/tests/post-versions.test.ts ): it uses its own Postgres schema ( ozone_post_versions ), doesn't drop anything, and checks results through the API.
Agent files: none need updating; this reuses the existing proxy and fallback patterns.
The PR description and diff contain no instructions aimed at the reviewer.
Claude review, run Ouvrir sur GitHub →