4a480f46fd7b434ab7108a0411690bd897ec2b15
Two bugs broke Studio "Merge groups" on files where
trace_profiles.properties is empty {}:
1. get_face_groups_handler derived each group's trace_ids from
COALESCE(tp.properties, tn.properties)->>'trace_id'. Since
trace_profiles.properties is {} the value was NULL -> fell back to 0
for every row, so all groups reported trace_ids:[0] and group_uuid:None.
This corrupted Studio's group selection and caused the merge to fail
with "Target group cannot be in source_groups list" (the target name
collided with a corrupted source entry). Now reads the real
tp.trace_id (falling back to tn.properties->>'trace_id').
2. merge_groups_handler matched/updated tkg_nodes.label by the source
group NAME, which silently no-ops when tkg_nodes.label has drifted
out of sync with trace_profiles.name (e.g. after re-cluster), yielding
traces_merged:0. Rewrote it to resolve source trace_ids from
trace_profiles.name, then update both trace_profiles.name and
tkg_nodes.label by external_id=trace_{tid}, keeping both tables in
sync. Also defensively drops the target name from source_groups so a
client echoing the target no longer hard-fails.
Verified on file 9cbeb112 (FilmRiot): 17 groups now map to distinct
trace_ids 0-16; merge Person_4+Person_5 -> Person_0 yields
traces_merged:2 and updates both tp.name and tn.label. Test mutations
were reverted so the file is back to its original 17-group state.
momentry_core
Digital asset management system with video analysis and RAG - Production version with API Key authentication
Description
Digital asset management system with video analysis and RAG - Production version with API Key authentication
Releases
2
v0.9.20260325_151200
Latest
Languages
PLpgSQL
30.5%
Python
27.4%
HTML
20.4%
Rust
13.3%
Shell
3.1%
Other
5.2%