Skip to content

[bug] Label assignment sends UUIDs instead of titles, creates polluting tags #14

Description

@dvlexp

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

  1. Log in to EVO CRM UI
  2. Open any conversation, click the three-dot menu → "Atribuir etiqueta" (assign label)
  3. Check any existing label in the modal
  4. Click "Aplicar" — HTTP 204 (success)
  5. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions