fix: crashes caused by invalid saved layout JSON and show toasts for recovery - #1560
Conversation
|
@vedansh-5 @rajnisht7 @Manik-Khajuria-5 @Jayantparashar10 please review |
|
@tonypzy Nice improvement. Consider adding a Cypress test for malformed localStorage JSON to verify the recovery path and guard against future regressions. |
cytest is not meant for handling such trivial cases. it is primarily designed to verify higher-level functionality, such as plotting features and screenshot pixel comparisons. |
|
@tonypzy Thanks for the clarification. That makes sense-this is better suited as a unit test than an end-to-end Cypress test. |
Manik-Khajuria-5
left a comment
There was a problem hiding this comment.
@tonypzy I agree with @rajnisht7 idea of adding in the ui section also
|

Description
This PR adds defensive JSON parsing (
safeJsonParse) to handle malformed JSON and prevent frontend runtime exceptions.Motivation and Context
The following malformed JSON cases are now safely handled by
safeJsonParse:How Has This Been Tested?
Check code manually
Screenshots (if appropriate):
N/A
Types of changes
Checklist:
py/visdom/VERSIONaccording to Semantic Versioning