fix(discovery): suggestSimilarInstances preview follows accepted-first representative rule (ISSUE-112) #1144
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/issue-112-suggest-similar-thumbnails"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
The media-viewer „Assign person" dropdown (suggested-people rows,
GET /api/discovery/domains/{domain}/instance-suggestions→suggestSimilarInstances) showed tentative (auto-assigned, unconfirmed) face crops as person previews: three inline thumbnail subqueries picked an arbitrary accepted-or-tentative crop (LIMIT 1, no ORDER BY, no named-instance guard).This is ISSUE-112 — the same bug class fixed for the picker rankings in
9e11330d, deliberately left untouched there to keep that PR thumbnail-only. Not a regression from the picker-latency work (method byte-identical before/after0740cf3f).Change
All three subqueries (embedding path, ILIKE name-search fallback, blank-query named-instance listing) now interpolate the shared
REPRESENTATIVE_FACE_THUMBNAIL_SUBQUERY, i.e. the ISSUE-095 rule:representative_occurrence_id) wins,Display-only — scores, occurrence counts, filters, result ordering and DTOs unchanged.
Validation
expected: null but was: /api/media/…/faces/…/thumbnail(tentative crop)ClassInstanceDiscoveryServiceTest326/326Closes ISSUE-112 (KNOWN_ISSURES.md update follows after merge).
The media-viewer 'Assign person' dropdown's suggested-people rows (suggestSimilarInstances, GET /api/discovery/domains/{domain}/instance- suggestions) derived thumbnail_url from three inline subqueries that picked an arbitrary accepted-or-tentative face crop (LIMIT 1, no ORDER BY, no named-instance guard) — a named person could surface a tentative (auto-assigned, unconfirmed) face as the preview. All three subqueries (embedding path, ILIKE name-search fallback, blank-query named-instance listing) now use the shared REPRESENTATIVE_FACE_THUMBNAIL_SUBQUERY, the exact rule the picker rankings got in9e11330d: pinned representative first, accepted beats tentative regardless of recency, named instances never serve a tentative crop, unnamed keep it as last-resort fallback. Display-only: scores, occurrence counts, filters and result ordering unchanged. Six regression tests across all three statements; red on unmodified main (expected null, got tentative crop URL), green with the fix (ClassInstanceDiscoveryServiceTest 326/326).