Commit 91b1040
committed
fix(webapp): guard Flux viewer against js-yaml 5.x empty-input throw
js-yaml 5.x (merged on 2.x via #8863) changed load('') to throw a
YAMLException ('expected a document, but the input is empty') instead of
returning undefined (see js-yaml migrate_v4_to_v5). The Flux Topology
Viewer calls parseAndRender() on page load while the textarea holds only
a comment (# YAML Definition), so jsyaml.load() now throws before the
existing if(doc==null) guard, breaking the viewer at runtime.
This latent bug shipped untested on 2.x because cypress-tests.yml was
scoped to master only, so 2.x PRs never ran the e2e suite.
Wrap the load in try/catch and treat empty/comment-only or malformed
input as 'no document', and broaden cypress-tests.yml to run on 2.x.1 parent 8d1bb71 commit 91b1040
2 files changed
Lines changed: 10 additions & 3 deletions
File tree
- .github/workflows
- storm-webapp/src/main/java/org/apache/storm/daemon/ui/WEB-INF
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
74 | 81 | | |
75 | 82 | | |
76 | 83 | | |
| |||
0 commit comments