Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: adding file name validation before adding file to database #103

Merged
merged 1 commit into from
Jan 25, 2024

Conversation

Caixetadev
Copy link
Collaborator

This pull request fixes an error that even if util.FilterFilename return an error, the application writes it to the database

Follow the flow to reproduce the error

  1. upload file with name Arquitetura Limpa - O Guia do Artesão para Estrutura e Design de Software (Robert C. Martin) (Z-Library).pdf guive an error
    image

  2. But even so, it still registers in the database
    image

  3. If I try to delete it, an error occurs.
    image

  4. However, even with the error, it still gets deleted from the database (requires refreshing the page).image

With the current state of this pull request, the issue is resolved. However, we need to investigate why the util.FilterFilename function returned an error for the file name. If necessary, we may have to make modifications to the util.FilterFilename function. Additionally, we need to look into why step 3 returned an error when I clicked delete. Nonetheless, in step 4, after refreshing the page, the data was deleted from the database despite the error.

@kevinanielsen kevinanielsen added api Improvements or additions to the api go Language: Go labels Jan 25, 2024
Copy link
Owner

@kevinanielsen kevinanielsen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good - I agree, the filterFilename function needs some work done

@kevinanielsen kevinanielsen merged commit 7f638b0 into kevinanielsen:main Jan 25, 2024
2 checks passed
@Caixetadev Caixetadev deleted the hotfix/upload-document branch January 25, 2024 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Improvements or additions to the api go Language: Go
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants