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

Errors When Uploading CSV File #51

Open
kayaelle opened this issue May 1, 2024 · 3 comments
Open

Errors When Uploading CSV File #51

kayaelle opened this issue May 1, 2024 · 3 comments
Assignees
Labels
bug Something isn't working medium priority

Comments

@kayaelle
Copy link
Member

kayaelle commented May 1, 2024

Describe the bug
For the "WIT Mock MIT Degree" Batch - using the Mock MIT Bachelor of Science Degree w/render credential template - uploading the attached csv file results in an internal server error in the console. On the screen it looks like the file didn't upload but if you go back to the batch from the issuance overview, it lists the credential recipients but with a "CSV is missing the following fields:
earnerName, subject, credentialName, emailAddress." and that isn't true.

I've checked for special characters, spaces, and blank lines in the csv file using both excel and textedit. I believe this is a problem with the csv file but can't track it down. Once we figure out the issue with the csv file, we should look into how to return an error in the interface that matches the actual issue with the csv file
WIT MIT Bachelor of Science Degree.csv
.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://dashboard.dcconsortium.org/admin/collections/credential-batch/6632509a883e43486eeb18cd?page=0)(https://dashboard.dcconsortium.org/admin/collections/credential-batch/6632509a883e43486eeb18cd?page=0)
  2. Click continue until you get to the "Upload & Manage Earner Information" screen
  3. Open console
  4. Upload attached csv file
  5. See error in console
  6. Go back to https://dashboard.dcconsortium.org/admin/collections/credential-batch/6632509a883e43486eeb18cd?page=0)
  7. Click through to "Upload & Manage Earner Information" screen to see list of earners and their info with an error message and disabled continue button.

Expected behavior
This csv file should be uploaded successfully. Note that if uploaded on the credential template, it validates.

@kayaelle kayaelle added bug Something isn't working priority labels May 1, 2024
@kayaelle
Copy link
Member Author

kayaelle commented May 1, 2024

Labeled as priority for the issue that may affect others but not for this particular credential issuing (they're fake demo credentials going to fake email addresses)

@jchartrand
Copy link
Contributor

jchartrand commented May 2, 2024

Likely that this email address in the CSV is invalid:

alovelace0-mail.com

At least I'm guessing so, based on the docker logs for the dashboard, which show an error:

ValidationError: The following field is invalid: emailAddress
ad-payload | at beforeChange (/home/node/app/node_modules/.pnpm/payload@1.13.4_@types[email protected][email protected]/node_modules/payload/src/fields/hooks/beforeChange/index.ts:55:11)
ad-payload | at processTicksAndRejections (node:internal/process/task_queues:95:5)
ad-payload | at create (/home/node/app/node_modules/.pnpm/payload@1.13.4_@types[email protected][email protected]/node_modules/payload/src/collections/operations/create.ts:179:29)
ad-payload | at /home/node/app/src/endpoints/createCredentialsForBatch.ts:16:45
ad-payload | at async Promise.all (index 0)
ad-payload | at createBatchCredentials (/home/node/app/src/endpoints/createCredentialsForBatch.ts:14:25) {
ad-payload | status: 400,
ad-payload | data: [
ad-payload | {
ad-payload | message: 'Please enter a valid email address.',
ad-payload | field: 'emailAddress'
ad-payload | }
ad-payload | ],
ad-payload | isPublic: false,
ad-payload | isOperational: true
ad-payload | }
ad-payload | ValidationError: The following field is invalid: emailTemplate

@kayaelle
Copy link
Member Author

Recommended next steps:

  • Evaluate why the validation of the csv file is different in the credential template upload versus the batch issuing upload.
  • Align the validation
  • Replace ".... fields are missing" with actual field(s) errors - preferably highlighting which recipient(s) have the error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working medium priority
Projects
Status: Admin Dashboard Backlog
Development

No branches or pull requests

3 participants