Bug summary
POST /api/v1/conversations/:id/labels is called by the frontend AssignmentModal with label IDs (UUIDs), but the backend uses acts_as_taggable_on whose update_labels method treats each string as a tag name. Result: new tags are created with UUIDs as names, real labels are never applied, and the taggings / tags tables get polluted.
Reproduction
- Log in to EVO CRM UI
- Open any conversation, click the three-dot menu → "Atribuir etiqueta" (assign label)
- Check any existing label in the modal
- Click "Aplicar" — HTTP 204 (success)
- Query DB:
SELECT t.name, tg.taggable_id
FROM taggings tg JOIN tags t ON tg.tag_id = t.id
ORDER BY tg.created_at DESC LIMIT 5;
Actual: rows show name = UUID string (e.g. b75f38fe-ac80-49b1-bc50-2e3591e8fec6), unrelated to any labels.title.
Expected: rows show name matching labels.title.
Root cause
Frontend — src/pages/Customer/Chat/Chat.tsx:625:
currentSelection: (conversationToAssign.labels || []).map(label => label.id),
And src/services/conversations/conversationService.ts:142:
async addLabels(conversationId, labels) {
return api.post(`/conversations/${conversationId}/labels`, { labels }); // labels are UUIDs
}
Backend — app/controllers/concerns/label_concern.rb:
def create
model.update_labels(permitted_params[:labels]) # acts_as_taggable, expects names
end
Suggested fix (frontend-side)
currentSelection should use label.title, and addLabels should send titles:
currentSelection: (conversationToAssign.labels || []).map(label => label.title),
Environment
- Image:
evoapicloud/evo-ai-crm-community:latest digest sha256:74027fc1...
- Image:
evoapicloud/evo-ai-frontend-community:latest digest sha256:29ba07fc...
- 10/11 services running, Postgres 16.13 + pgvector
Bug summary
POST /api/v1/conversations/:id/labelsis called by the frontendAssignmentModalwith label IDs (UUIDs), but the backend usesacts_as_taggable_onwhoseupdate_labelsmethod treats each string as a tag name. Result: new tags are created with UUIDs as names, real labels are never applied, and thetaggings/tagstables get polluted.Reproduction
Actual: rows show
name= UUID string (e.g.b75f38fe-ac80-49b1-bc50-2e3591e8fec6), unrelated to anylabels.title.Expected: rows show
namematchinglabels.title.Root cause
Frontend —
src/pages/Customer/Chat/Chat.tsx:625:And
src/services/conversations/conversationService.ts:142:Backend —
app/controllers/concerns/label_concern.rb:Suggested fix (frontend-side)
currentSelectionshould uselabel.title, andaddLabelsshould send titles:Environment
evoapicloud/evo-ai-crm-community:latestdigestsha256:74027fc1...evoapicloud/evo-ai-frontend-community:latestdigestsha256:29ba07fc...