Files
Eric MeyandClaude Opus 5 55ff0d4694 Wait for the storage move before setting the description
Immich queues a sidecar write from the description PUT, and that job
resolves the asset path as it stood when the job was queued. The storage
template engine moves the file from upload/ into library/ roughly 270ms
after upload, so the PUT was racing the move: the job woke to a path that
had already gone and died with ENOENT.

The asset always survived — active, in the library, exif intact. What was
lost was the .xmp sidecar, and the failures tripped ImmichJobFailures on
photo-club about one upload in five.

Poll the asset until it leaves upload/, then set the description. The wait
is bounded at 5s and gives up gracefully: a deployment with the storage
template engine switched off keeps its files in upload/ forever, so the
first asset that never moves disables the wait for the rest of the batch
and descriptions are set immediately as before.

POST /api/assets cannot carry a description in Immich v3.1.0 —
AssetMediaCreateSchema accepts fileCreatedAt, fileModifiedAt, duration,
filename, assetData, isFavorite, visibility, livePhotoVideoId, metadata
and sidecarData, and nothing else — so collapsing this to a single call
is not available.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-19 12:10:27 -04:00
..