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

grain.social/grain

photography-focused photo sharing platform

grain.social
1 collaborator
0
2

Photos post on PDSes that still require alt

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

What changes

The same fix as the pull into main, on this branch's write sites: create, gallery edit, import, and crates/grain-serve/src/spaces/pool.rs, which group create goes through. Every photo write now carries alt, empty when there is no description. AGENTS.md records the rule under Lexicons.

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 each write site. Left to CI: check, test and the Rust tests. Not run here or against a refusing PDS.

Shortcomings

Merging main into this branch will bring the same edits under app/ and server/, which may need resolving against the moved paths.

🤖 Generated with Claude Code

chadtmiller.com added 1 commit
Approved

This makes every photo write carry alt, using an empty string when there is no description. That covers the create page, both the create and update writes in gallery edit, the import page, and the group gallery write in spaces/pool.rs. I searched web/src and crates for other photo write sites on this branch and found none. The AGENTS.md note under Lexicons matches the change.

Two small points, neither blocking:

  • In pool.rs, photos_of copies alt into the view whenever it isn't null, so photos written with no description now show alt: "" instead of no alt. That is harmless for readers, but the spaces tests that compare views may need to allow it. CI will show that.
  • I didn't run anything. The PR body says the checks are left to CI.
Merged as 615d92a
Part of a stack of 2
  1. Photos post on PDSes that still require alt Landed as 615d92a
  2. main