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

Form-builder Preview not handling an unlikely error of loading invalid JSON #4039

Open
thiessenp-cds opened this issue Jul 19, 2024 · 0 comments
Labels
App bug Something isn't working

Comments

@thiessenp-cds
Copy link
Contributor

thiessenp-cds commented Jul 19, 2024

It is possible for the Preview page to load invalid JSON and if this happens there is currently no good way to notify the user this happened.

For this error to occur, a user would need to directly access /form-builder/0000/preview and the parsed JSON from getSchema() contain invalid JSON. I've only been able to simulate this manually in the code. But it is still a possible error and potentially an error that would seriously confuse a user.

For example, a user would see this toast about invalid JSON. Then If s/he clicked download, the default template would be downloaded which is valid JSON. (and hide the file with invalid JSON)
Screenshot 2024-07-19 at 2 06 39 PM

An initial PR was done to handle thrown errors from JSON here: #3995

This is a followup PR to think about how best to handle this error case.

@thiessenp-cds thiessenp-cds added bug Something isn't working App labels Jul 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
App bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant