0
2
Photos post on PDSes that still require alt
app/routes/create/+page.svelte+1−1
| @@ -263,7 +263,7 @@ | ||
createWrite('social.grain.photo', photoRkeys[i], { | ||
photo: blobs[i], | ||
aspectRatio: { width: photo.width, height: photo.height }, | ||
...(photo.alt ? { alt: photo.alt } : {}), | ||
alt: photo.alt || '', | ||
createdAt: now, | ||
}), | ||
), | ||
app/routes/profile/[actor]/gallery/[rkey]/edit/+page.svelte+2−2
| @@ -353,7 +353,7 @@ | ||
createWrite('social.grain.photo', photoRkey, { | ||
photo: blobBySlot.get(i), | ||
aspectRatio: { width: slot.processed.width, height: slot.processed.height }, | ||
...(slot.processed.alt ? { alt: slot.processed.alt } : {}), | ||
alt: slot.processed.alt || '', | ||
createdAt: now, | ||
}), | ||
) | ||
| @@ -388,7 +388,7 @@ | ||
updateWrite('social.grain.photo', photoRkey, { | ||
photo: blobBySlot.get(i), | ||
aspectRatio: { width: slot.replacement.width, height: slot.replacement.height }, | ||
...(slot.view.alt ? { alt: slot.view.alt } : {}), | ||
alt: slot.view.alt || '', | ||
createdAt: (slot.view as any).record?.createdAt ?? now, | ||
}), | ||
) | ||
app/routes/settings/import/+page.svelte+1−0
| @@ -117,6 +117,7 @@ | ||
createWrite('social.grain.photo', photoRkeys[i], { | ||
photo: blobs[i], | ||
aspectRatio: { width: photo.width, height: photo.height }, | ||
alt: '', | ||
createdAt, | ||
}), | ||
), | ||
server/xrpc/createPoolGallery.ts+1−1
| @@ -73,7 +73,7 @@ export default defineProcedure("social.grain.unspecced.createPoolGallery", async | ||
value: { | ||
$type: "social.grain.photo", | ||
photo: photo.photo, | ||
...(photo.alt ? { alt: photo.alt } : {}), | ||
alt: photo.alt || "", | ||
aspectRatio: photo.aspectRatio, | ||
createdAt, | ||
}, | ||
server/xrpc/createPrivateGallery.ts+1−1
| @@ -101,7 +101,7 @@ export default defineProcedure("social.grain.unspecced.createPrivateGallery", as | ||
value: { | ||
$type: "social.grain.photo", | ||
photo: photo.photo, | ||
...(photo.alt ? { alt: photo.alt } : {}), | ||
alt: photo.alt || "", | ||
aspectRatio: photo.aspectRatio, | ||
createdAt, | ||
}, | ||
AGENTS.md+11−0
| @@ -135,6 +135,17 @@ first and falls back to `simplespace` on a 404 or 501. | ||
When touching the space client, check a call against both servers' handlers: | ||
`packages/spaces/src/handlers/` in pds.js, `src/atproto/space.zig` in zds. | ||
| ||
## Photo writes always send `alt` | ||
| ||
`@atproto/pds` validates writes against schemas compiled into the server, not | ||
the ones grain.social publishes (`validateRecord` in | ||
`packages/pds/src/repo/prepare.ts`). Its copy of `social.grain.photo` requires | ||
`alt`, so a photo without it is refused, and hatk reports that as a 500 on | ||
`dev.hatk.applyWrites`. Send `alt: ""` when there is no description. | ||
| ||
The same goes for any schema change: publishing it does not reach these servers. | ||
A write has to stay valid against the copy they ship until they upgrade. | ||
| ||
## Production debugging | ||
| ||
Production is a single Hetzner host, `167.233.237.163`, running the appview, | ||