Fixes issue #879 by thiagoomatheus · Pull Request #1456 · EvolutionAPI/evolution-api · GitHub
Skip to content

Fixes issue #879#1456

Merged
DavidsonGomes merged 1 commit intoEvolutionAPI:developfrom
thiagoomatheus:main
May 16, 2025
Merged

Fixes issue #879#1456
DavidsonGomes merged 1 commit intoEvolutionAPI:developfrom
thiagoomatheus:main

Conversation

@thiagoomatheus
Copy link
Copy Markdown
Contributor

@thiagoomatheus thiagoomatheus commented May 16, 2025

Erro ao enviar arquivo com o mesmo nome através da opção DOCUMENTO, pelo whatsapp WEB (PT)

Error when sending a file with the same name via the DOCUMENT option, via WhatsApp WEB (EN)

Quando o usuário envia duas vezes ou mais um arquivo com o mesmo nome, através da opção DOCUMENTO, através do WHATSAPP WEB, está dando erro. Percebi que existe uma chave unica no banco de dados com o nome do arquivo. (PT)

When the user sends a file with the same name twice or more, through the DOCUMENT option, through WHATSAPP WEB, an error is being thrown. I noticed that there is a unique key in the database with the file name. (EN)

The original code in model Media schema includes a "@unique" atribute in fileName field. This atribute don't allow the user to save multiple files with same name resulting in error reported in issue #879.

This update allow the user to receive multiples files with same name.

The code remove "@unique" atribute on fileName field and includes the migration.

Summary by Sourcery

Remove the unique constraint on the fileName field in the Media model to resolve errors when uploading files with duplicate names via WhatsApp Web.

Bug Fixes:

  • Allow multiple files with the same name to be saved by removing the unique constraint on the fileName field in the Media model.

Build:

  • Add a database migration to drop the unique index on the Media fileName field.

@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai Bot commented May 16, 2025

@DavidsonGomes DavidsonGomes changed the base branch from main to develop May 16, 2025 15:16
@DavidsonGomes DavidsonGomes merged commit 7cccda1 into EvolutionAPI:develop May 16, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants