Photos post on PDSes that still require alt
Mergedchadtmiller.com added 1 commit
Approved
This makes GalleryDraft.writes() always set alt on social.grain.photo records, using an empty string when there is no description. That avoids the PDS's "Missing required key alt" refusal. The change is minimal and matches the stated reasoning. I read the diff and the surrounding write site. The new test uses ApplyWrite.collection and .value (an AnyCodable) and makeDraft(photoCount:uploaded:). All three exist in the repo, so it should compile. I didn't build or run it. The repository has no AGENTS.md or CLAUDE.md on the base branch. I found nothing that needs changing.
Merged as 1dc3cca

What changes
GalleryDraftnow writesalton every photo, empty when there is no description. Nothing changes on screen:GalleryCardViewalready treats an emptyaltas none. AddstestEveryPhotoWriteCarriesAlt.Why
@atproto/pdsvalidates writes against schemas compiled into the server (validateRecordinpackages/pds/src/repo/prepare.ts), not the ones grain.social publishes. Its copy ofsocial.grain.photorequiresalt, 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 emptyaltpasses both that copy and the published schema.How it was checked
Read the write site and the readers. Left to CI: format and lint. Not built or run here, and not tried on a simulator or against a refusing PDS.
Shortcomings
GrainTests; if not, run it in Xcode.🤖 Generated with Claude Code