Skip to content

Conversation

@ketanwani
Copy link

Problem

A number of users have been complaining of failed bulk link uploads because the last row of their uploaded CSV file is empty, and they seem to be unable to debug and fix the issue on their own. It would be nice if Go's backend could help to remove or ignore any extra empty rows when parsing the CSV file, so users are less likely to encounter upload errors

Closes [insert issue #]
#2153

Solution

Handle logic to ignore excel/csv rows which are empty in the end.

Before & After Screenshots

BEFORE:

output.mp4

AFTER:

output1.mp4

Copy link
Collaborator

@seaerchin seaerchin left a comment

Choose a reason for hiding this comment

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

no issues apart from a minor formatting issue

Comment on lines +89 to +108
let errorMessage = `Row ${counter + 1}: `
if (!acceptableLinkCount) {
errorMessage += 'exceeds maximum number of links'
} else if (!onlyOneColumn) {
errorMessage += 'has more than one column'
} else if (!isNotBlacklisted) {
errorMessage += 'contains blacklisted link'
} else if (!isNotEmpty) {
errorMessage += 'is empty'
} else if (!isValidUrl) {
errorMessage += 'contains invalid url'
} else if (isNotCircularRedirect) {
errorMessage += 'contains circular redirect'
} else if (!noParsingError) {
errorMessage += 'has parsing error'
}
dogstatsd.increment(BULK_VALIDATION_ERROR, 1, 1, [
`${BULK_VALIDATION_ERROR_TAGS.isValidUrl}`,
])
throw new Error(errorMessage)
Copy link
Collaborator

Choose a reason for hiding this comment

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

not entirely sure - can there only be 1 error per line? if there's possibly >1, then the formatting might be abit awkward

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