fix(people): keep representative bbox when face thumbnail not yet generated #651

Merged
chris merged 3 commits from fix/people-rep-bbox-without-thumbnail into main 2026-07-19 19:42:28 +02:00
Owner

Bug

Detail page + browse list show full photo instead of face crop for people created via face assignment, because representativeBbox is null.

Root cause

SQL CTEs manual_selected and auto_selected in representativeEnrichmentForPeople filter on face_thumbnail_key IS NOT NULL, dropping faces that have no derived face-crop asset yet. This loses the bounding_box from face_annotations.scope along with the face.

Fix

Remove the two AND face_thumbnail_key IS NOT NULL WHERE lines from both CTEs. Faces without thumbnails are now still selected as representatives, preserving their bounding_box. The representativeCroppedThumbnailUrl is only set when the underlying derived asset exists, so no 404 occurs.

Test impact

  • Updated personWithoutFaceThumbnailReturnsNullPreviewUrl — face without thumbnail is now selected as representative
  • Added personWithoutFaceThumbnailReturnsBboxFromFaceAnnotation — verifies bbox populated from face_annotations.scope
## Bug Detail page + browse list show full photo instead of face crop for people created via face assignment, because `representativeBbox` is null. ## Root cause SQL CTEs `manual_selected` and `auto_selected` in `representativeEnrichmentForPeople` filter on `face_thumbnail_key IS NOT NULL`, dropping faces that have no derived face-crop asset yet. This loses the bounding_box from `face_annotations.scope` along with the face. ## Fix Remove the two `AND face_thumbnail_key IS NOT NULL` WHERE lines from both CTEs. Faces without thumbnails are now still selected as representatives, preserving their bounding_box. The `representativeCroppedThumbnailUrl` is only set when the underlying derived asset exists, so no 404 occurs. ## Test impact - Updated `personWithoutFaceThumbnailReturnsNullPreviewUrl` — face without thumbnail is now selected as representative - Added `personWithoutFaceThumbnailReturnsBboxFromFaceAnnotation` — verifies bbox populated from `face_annotations.scope`
fix(people): keep representative bbox when face thumbnail not yet generated
All checks were successful
Build and Deploy / Detect changed services and test scopes (push) Successful in 3s
Build and Deploy / Build plants worker image (push) Has been skipped
Build and Deploy / Smoke API and media worker (push) Has been skipped
Build and Deploy / Smoke web (push) Has been skipped
Build and Deploy / Smoke ML worker (push) Has been skipped
Build and Deploy / Build people worker image (push) Has been skipped
Build and Deploy / Build converter worker image (push) Has been skipped
Build and Deploy / Build ML worker image (push) Has been skipped
Build and Deploy / Build API image (push) Has been skipped
Build and Deploy / Build media worker image (push) Has been skipped
Build and Deploy / Build web image (push) Has been skipped
Build and Deploy / Deploy API (push) Has been skipped
Build and Deploy / Deploy web (push) Has been skipped
Build and Deploy / Deploy media worker (push) Has been skipped
Build and Deploy / Deploy ML worker (push) Has been skipped
Build and Deploy / Deploy plants worker (push) Has been skipped
Build and Deploy / Deploy people worker (push) Has been skipped
Build and Deploy / Deploy converter worker (push) Has been skipped
Build and Deploy / Clean Docker build artifacts (push) Has been skipped
Build and Deploy / Run scoped PR tests (push) Successful in 3m41s
0273cd6423
Remove AND face_thumbnail_key IS NOT NULL from manual_selected and
auto_selected CTEs in representativeEnrichmentForPeople. This ensures
faces without a derived face-crop asset are still selected as the
person representative, preserving their bounding_box from
face_annotations.scope.

Previously, faces created via face assignment (before thumbnail
generation) were dropped from representative selection entirely,
causing representativeBbox to be null on the detail page and browse
list — falling back to the full photo instead of the face crop.

PR#650: 3-branch fallback CTE. The 3rd branch (else_selected) was
already added but these filters prevented faces from reaching it
when no thumbnail existed yet.
chore(release): bump version to v1.21.12
All checks were successful
Build and Deploy / Detect changed services and test scopes (push) Successful in 3s
Build and Deploy / Smoke API and media worker (push) Has been skipped
Build and Deploy / Smoke web (push) Has been skipped
Build and Deploy / Smoke ML worker (push) Has been skipped
Build and Deploy / Build plants worker image (push) Has been skipped
Build and Deploy / Build people worker image (push) Has been skipped
Build and Deploy / Build converter worker image (push) Has been skipped
Build and Deploy / Build API image (push) Has been skipped
Build and Deploy / Build media worker image (push) Has been skipped
Build and Deploy / Build ML worker image (push) Has been skipped
Build and Deploy / Build web image (push) Has been skipped
Build and Deploy / Deploy API (push) Has been skipped
Build and Deploy / Deploy web (push) Has been skipped
Build and Deploy / Deploy media worker (push) Has been skipped
Build and Deploy / Deploy ML worker (push) Has been skipped
Build and Deploy / Deploy plants worker (push) Has been skipped
Build and Deploy / Deploy people worker (push) Has been skipped
Build and Deploy / Deploy converter worker (push) Has been skipped
Build and Deploy / Clean Docker build artifacts (push) Has been skipped
Build and Deploy / Run scoped PR tests (push) Successful in 2m12s
9d4f5245c1
docs(changelog): add v1.21.12 changelog entry
All checks were successful
Build and Deploy / Detect changed services and test scopes (push) Successful in 2s
Build and Deploy / Build plants worker image (push) Has been skipped
Build and Deploy / Build people worker image (push) Has been skipped
Build and Deploy / Build converter worker image (push) Has been skipped
Build and Deploy / Run scoped PR tests (push) Has been skipped
Build and Deploy / Smoke API and media worker (push) Has been skipped
Build and Deploy / Smoke web (push) Has been skipped
Build and Deploy / Smoke ML worker (push) Has been skipped
Build and Deploy / Build media worker image (push) Has been skipped
Build and Deploy / Build ML worker image (push) Has been skipped
Build and Deploy / Build API image (push) Has been skipped
Build and Deploy / Build web image (push) Has been skipped
Build and Deploy / Deploy API (push) Has been skipped
Build and Deploy / Deploy web (push) Has been skipped
Build and Deploy / Deploy media worker (push) Has been skipped
Build and Deploy / Deploy ML worker (push) Has been skipped
Build and Deploy / Deploy plants worker (push) Has been skipped
Build and Deploy / Deploy people worker (push) Has been skipped
Build and Deploy / Deploy converter worker (push) Has been skipped
Build and Deploy / Clean Docker build artifacts (push) Has been skipped
6472238935
chris merged commit 7d4d91b509 into main 2026-07-19 19:42:28 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
chris/memories!651
No description provided.