~ knotless Search/
↑↓ move↵ open⇧↵ all results

grain.social/grain-android

1 collaborator
0
1

Photos post on PDSes that still require alt

Merged
Merged chadtmiller.com asked to merge into main from grain.social/grain-android:fix/photo-alt-always

What changes

GalleryDraft now writes alt on every photo, empty when there is no description. Nothing changes on screen: GalleryCard shows its ALT badge only for a non-blank alt. Extends theCommitCarriesAPhotoAnItemAndTheGalleryForEachFrame to assert the empty value.

Why

@atproto/pds validates writes against schemas compiled into the server (validateRecord in packages/pds/src/repo/prepare.ts), not the ones grain.social publishes. Its copy of social.grain.photo requires alt, so the PDS refuses a photo with no description: Invalid social.grain.photo record: Missing required key "alt". Prod logs show 252 refusals across 14 accounts from Nov 2 to Nov 6, reported at https://github.com/grainsocial/grain/issues/24. The logs do not say which client sent them, so how many came from this app is unknown. An empty alt passes both that copy and the published schema.

How it was checked

Read the write site and the badge. Left to CI. Not built or run here, and not tried on an emulator or against a refusing PDS.

Shortcomings

It only helps once a release ships, so people on older builds stay affected until they update.

🤖 Generated with Claude Code

chadtmiller.com added 1 commit
Approved

GalleryDraft now always writes alt, trimmed and empty when there is no description. The test now also asserts the empty value on the second photo.

I checked the display claim in GalleryCard.kt. The ALT badge (line 514) and the tap-to-show-alt branch (line 425) both use isNullOrBlank, so an empty alt still shows no badge. Nothing in the create-gallery UI depends on whether the record has alt. The test change is correct: the second photo is built with the default alt, and writes.last picks its record.

I didn't build or run it, and neither did the author. The pull body says so.

Merged as 4a7bbed