Closed cholly75 closed 1 month ago
Expected Results:
*Repeat this test as a Private Practitioner
Expected Results:
Expected Results:
*Repeat this test as a Private Practitioner
Expected Results:
Expected Results:
Repeat this test by selecting all of the business types available Repeat this test as a Private Practitioner
Expected Results:
Expected Results:
*Repeat this test with a Private Practitioner and an IRS Practitioner.
Expected Results:
Expected Results:
Repeat this test by adding multiple supporting documents, ensuring that for each supporting document, you receive the error message (can add up to 5 supporting documents for each filing) Repeat this test with a Private Practitioner and an IRS Practitioner.
Expected Results:
Note: 02 and 03 blocked because this code is the same as those stories. We want to use this story to inform how the other two stories will move forward.
https://trello.com/c/J4S7ZhKx/1187-convert-validation-messages-for-entities-to-using-joi-syntax https://trello.com/c/KZCJa3fh/1188-convert-all-entities-to-es6-style-classes https://trello.com/c/9XuhSxO8/1189-parent-entities-that-expect-to-display-validation-errors-for-child-entities-need-to-know-child-entitiy-schema-at-or-before-run-t https://trello.com/c/NnW4cAkj/1190-modify-joivalidationentitygetformattederrormessages-to-not-be-recursive-use-standard-joischemavalidate
Pre refinement
I've looked over this and #10002. After some helpful discussion with Zach, here are my thoughts:
Ideally, we want whatever solution we have here to be 1) helpful for the user (this is probably most important), 2) consistent with the app.
RE: 1) What would be most helpful for the user? Immediate feedback upon file selection rather than having to wait on submit (especially if there are multiple files in the form), similar to the alert generated by limitFileSize.ts
. This suggests we should use some frontend validation.
RE: 2) How do we currently show errors in the app?
ErrorNotification
, on form submission.limitFileSize.ts
)completeDocketEntryQCAndSendMessageSequence.ts
)Which is the best approach in our case? Probably showing an inline error or an alert. I think showing ErrorNotification
accords more with form submission than with file selection, and, as mentioned above, I think validation of basic file constraints should occur on file selection. (So long as we can do these checks quickly!)
Therefore, my recommendation is to use pdfjs-dist
to do some basic pdf validation on the frontend. We can have something like ClientPdfValidator
, which checks for file size, encryption, and non-pdf .pdfs. We can use this in StateDrivenFileInput
so that it is available for every file upload. On errors, I suggest we follow an approach similar to what we do for file size, but show a custom modal alert rather than a JS alert
(which doesn't allow links, which we might want for explanations of "Why is my pdf encrypted?"). (I suggest we also use this custom alert for the file size error, too.) If we still want logs for these errors in OpenSearch, we can fire some event to the backend to do so.
Note that this approach would not use entity validation. That said, I think we have at least some conceptual justification here: we validate fields one way, validate file selections in another. In other words, file selection validation would come before modifying the form, similar to an invalid keystroke. This doesn't feel terribly messy.
I've worked on this a little more. I think inline, the original suggestion, works too. I'll work on implementing that.
I've talked with the team about two options forward for #10001 and #10002. (Tenille also mentioned it might be worth investigating #10003, which I will look into as well.) Option 1 was inline errors with yucky code, option 2 was modal errors with better code. We opted for option 2, the modal errors.
A few important points/open questions that were brought up:
A few cursory thoughts: RE: 4: I think one at a time is easiest and makes sense. I'm not sure how much more helpful aggregate messages would be, and I think this would be a rare case. RE: 5: I think we can essentially keep the same behavior in place (showing a catch-all modal), maybe modifying the language slightly. The earlier, on-file-select validation should catch most errors before that. Then we can incrementally improve as needed.
All notes apply to 10001, 10002, and 10003
Figma File showing different messaging examples.
A quick update: after a brief discussion, we have decided to show the file size too big error first (when applicable) to avoid potentially parsing a giant file when validating.
Another update: 1) Because the error messages should never overlap (e.g., we cannot read a corrupted PDF to tell if it is encrypted, and vice-versa), we have decided to forego the multiple-error-message modal until needed. 2) After experimenting with big files and throttling my browser, we have decided to show the loading modal overlay while the file is being validated.
I've pushed to flexion experimental1 and am doing/have done some tests before polishing the code and preparing to push to test. One of the main things I am testing is that large files (around the maximum of 250 MB) do not take too long to validate on different devices. (Since file uploading is such an essential part of the app, I want to test thoroughly!) All of my results so far have been positive:
Ultimately, the new approach in 10001-10003 has been to validate files on file selection, which I think is a great start.
A good follow-up ticket: provide better messaging on failed submissions. This means a couple of different things:
@Mwindo you can use this URL for the troubleshooting link: https://ustaxcourt.gov/dawson_faqs_case_management.html#FileUpload
@Mwindo Some testing feedback:
If you upload a file that was signed using Adobe sign, it will put the document in a Password Protected/secured state. Documents in this state are still being able to be uploaded without error, until the final submission step, where the user is now getting the firewall error since it didn't catch it at the initial upload. See the secured test document that I sent you via slack. This document results in the "Invalid PDF" error in the logs. Thanks!
Thanks @ttlenard! My implementation only checked password protection on read, not on edit (which we need since DAWSON modifies PDFs by stamping, adding cover sheets, etc.). I have a fix I will get reviewed that checks for password protection on edit as well.
@Mwindo Some testing feedback:
@cholly75 All you will need to test when the adjustment above is made is to test as an admissions clerk and upload various file types (including excel, csv, etc.) into the Practitioner database. You shouldn't receive any pop-up indicating that you can't upload the documents, even if they are in a file type not specifically specified in the instructional text.
Thanks @ttlenard! (I misunderstood an earlier comment about not validating files--I was thinking, "Don't do any file-specific validation" instead of "don't do any generic file-type validation at all"). I've updated the code in test.
Thanks @ttlenard! (I misunderstood an earlier comment about not validating files--I was thinking, "Don't do any file-specific validation" instead of "don't do any generic file-type validation at all"). I've updated the code in test.
As petitioner or practitioner, so that I know how to correct problems when uploading files , I need more detailed responses when I upload an encrypted or password protected PDF.
Currently when a user uploads a file in DAWSON, if the file does not meet certain criteria we display an error in the UI and ask them to try again. Even though there are a few commonly seen specific causes for the error, we do not give the user any indication of what the problem might be to help them successfully upload the file on subsequent retries.
We would like to display custom error messaging in these cases to help our external users understand what problems they need to address in their file before attempting to re-upload it. We have been able to connect several root causes for upload problems with specific logfile messages in Kibana, and we should display helpful information to the user based on the error seen in those messages.
Pre-Conditions
Acceptance Criteria
Notes
We will probably want to adjust the wording in the current error message that is at the end of the workflow when this story is implemented. Once this story is in place, the current error message will no longer be valid:
Here is the current error we see in the logs:
Tasks
submitExternalDocumentSequence
) into validation of file upload (validateExternalDocumentInformationSequence
) for external usersTest Cases
Story Definition of Ready (updated on 12/23/22)
The following criteria must be met in order for the user story to be picked up by the Flexion development team. The user story must:
Definition of Done (Updated 5-19-22)
Product Owner
UX
Engineering
test
environment if prod-like data is required. Otherwise deployed to anyexperimental
environment.staging
environment.