waiyan93 / web-scraping

0 stars 0 forks source link

[Bug] Uploading a CSV containing empty line breaks causes an endless loop #7

Closed olivierobert closed 2 years ago

olivierobert commented 2 years ago

Issue

The CSV validation is not checking for empty line breaks causing an endless loop i.e., the upload is never completed:

image

The progress bar even goes to 200% 😅

Upon checking the network request tab in the Chrome developer tools, here is the request's response that is sent back to the client application over and over:

{"csv":{"id":3,"user_id":1,"path":"csvs\/9buTS18Gx9VXW1QlPfdLAsGRxVMzj4qqnTOQRWrF.txt","total_keywords":4,"total_scraped_keywords":9,"is_scraped":false,"created_at":"2022-04-04T06:06:27.000000Z","updated_at":"2022-04-04T06:06:37.000000Z"}}

Expected

Since the CSV file is user-generated, it is crucial to have enhanced checks for empty spaces, invalid characters, etc.

Steps to reproduce

  1. Go to http://54.255.20.202/results/create
  2. Upload a CSV with the following content:
reactjs
flights
hotels