fix(people): emit suggested-people thumbnail URLs only when face crop asset exists #708

Merged
chris merged 1 commit from fix/face-suggestion-thumbnail-404 into main 2026-09-06 09:55:28 +02:00
Owner

Summary

The Suggested people dialog rendered broken image icons for every suggestion: the 3 thumbnail-URL subqueries in ClassInstanceDiscoveryService.suggestSimilarInstances emitted /api/media/{media}/faces/{face}/thumbnail unconditionally, but DerivedAssetController.faceThumbnail serves the crop only when discovery_results.thumbnail_derived_asset_id resolves to a face_thumbnail derived_assets row. Verified on the owner instance: 0 of 16,411 people faces have that link (legacy face-thumbnail generation was removed with spec 014 phase 2; existing 51k assets reference pre-spec036 face ids). Every URL therefore 404ed.

Change

All 3 subqueries (embedding candidates, name fallback, blank-query fallback) now JOIN derived_assets da2 ON da2.id = dr2.thumbnail_derived_asset_id AND da2.derived_type = 'face_thumbnail' — URLs are emitted only when the asset exists. Null URLs degrade to the text+count row already supported by MediaInfoPanel (same pattern as merged PR #657). Follow-up candidates noted (not in scope): ClassInstanceAutomationRunService.java:240 same blind pattern; face-thumbnail generation pipeline itself is dead and would need revival as a worker feature.

Tests

  • 2 new regression tests (URL omitted when asset missing; URL emitted when asset exists)
  • H2 shared schema extended (thumbnail_derived_asset_id, derived_assets storage columns); ClassInstanceServiceTest ALTER made idempotent
  • ClassInstanceDiscoveryServiceTest 63/63 green; 187 tests across the 6 schema-sharing classes green
## Summary The Suggested people dialog rendered broken image icons for every suggestion: the 3 thumbnail-URL subqueries in `ClassInstanceDiscoveryService.suggestSimilarInstances` emitted `/api/media/{media}/faces/{face}/thumbnail` unconditionally, but `DerivedAssetController.faceThumbnail` serves the crop only when `discovery_results.thumbnail_derived_asset_id` resolves to a `face_thumbnail` derived_assets row. Verified on the owner instance: 0 of 16,411 people faces have that link (legacy face-thumbnail generation was removed with spec 014 phase 2; existing 51k assets reference pre-spec036 face ids). Every URL therefore 404ed. ## Change All 3 subqueries (embedding candidates, name fallback, blank-query fallback) now `JOIN derived_assets da2 ON da2.id = dr2.thumbnail_derived_asset_id AND da2.derived_type = 'face_thumbnail'` — URLs are emitted only when the asset exists. Null URLs degrade to the text+count row already supported by MediaInfoPanel (same pattern as merged PR #657). Follow-up candidates noted (not in scope): ClassInstanceAutomationRunService.java:240 same blind pattern; face-thumbnail generation pipeline itself is dead and would need revival as a worker feature. ## Tests - 2 new regression tests (URL omitted when asset missing; URL emitted when asset exists) - H2 shared schema extended (thumbnail_derived_asset_id, derived_assets storage columns); ClassInstanceServiceTest ALTER made idempotent - ClassInstanceDiscoveryServiceTest 63/63 green; 187 tests across the 6 schema-sharing classes green
fix(people): emit suggested-people thumbnail URLs only when face crop asset exists
All checks were successful
Build and Deploy / Detect changed services and test scopes (push) Successful in 4s
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 12m46s
30971ce20f
suggestSimilarInstances built /faces/{id}/thumbnail URLs blindly; the
endpoint 404s unless discovery_results.thumbnail_derived_asset_id
resolves to a face_thumbnail derived_assets row. Production data: 0 of
16411 people faces have the link (legacy generation pipeline removed),
so every suggestion thumbnail rendered broken. All 3 URL subqueries now
join derived_assets and emit the URL only when the crop exists; the
dialog already renders a text-only row for null URLs (PR#657 pattern).

Known issues: ISSUE-029 (med, resolved).
chris merged commit 49a4fee9a7 into main 2026-09-06 09:55: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!708
No description provided.