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

Handle Invalid Date responses #261

Open
tim-macphail opened this issue Mar 23, 2023 · 0 comments
Open

Handle Invalid Date responses #261

tim-macphail opened this issue Mar 23, 2023 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@tim-macphail
Copy link
Collaborator

tim-macphail commented Mar 23, 2023

With the introduction of the /premium-files endpoint, the openai api sometimes doesn't give a valid date in the response.
E.g. the response.assessments = {name: "Final exam", weight: 30, date: null}

This needs to be handled properly. Right now, it will load into the frontend and sit at the bottom of the assessments list without throwing any errors. A date can be manually added to it by editing it. However, if one doesn't add a date before trying to export, uncaught errors will be thrown in icsGen.ts
image
This can be recreated by uploading CPSC331.pdf sometimes.

We need to decide how to handle this. Options
1. In the server, drop assessments with invalid dates.

  • pros: requires no change to frontend, easy to implement
  • cons: the assessment often does exist but just doesn't have a date stated in the outline, so it might be useful to keep that info

2. In client, skip over assessments with no date when generating iCal. Could even have a toast/alert notifying user that this is happening

  • pros: fixes errors
  • cons: assesment is dropped

3. In client, don't allow export until date field has a value

  • pros: no assessment slips through the cracks
  • cons: harder to implement. Definitely would require Delete assessment #162 to be done

Edit: We'll go with 3. Blocked by #177

@tim-macphail tim-macphail added the bug Something isn't working label Mar 23, 2023
@tim-macphail tim-macphail self-assigned this Mar 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant