Skip to content

fix(webapp): guard Flux viewer against js-yaml 5.x empty-input throw#8889

Merged
rzo1 merged 2 commits into
dependabot/npm_and_yarn/storm-webapp/js-yaml-5.2.0from
fix-flux-jsyaml-v5-empty-doc
Jul 1, 2026
Merged

fix(webapp): guard Flux viewer against js-yaml 5.x empty-input throw#8889
rzo1 merged 2 commits into
dependabot/npm_and_yarn/storm-webapp/js-yaml-5.2.0from
fix-flux-jsyaml-v5-empty-doc

Conversation

@rzo1

@rzo1 rzo1 commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Fixes the cypress-e2e failure seen on #8855 (js-yaml 4.2.0 → 5.2.0).

Root cause

js-yaml 5.x changed load('') to throw YAMLException: expected a document, but the input is empty instead of returning undefined (see the v4→v5 migration guide). A comment-only string counts as empty.

The Flux Topology Viewer (flux.html) calls parseAndRender() on page load while the textarea contains only # YAML Definition, so jsyaml.load(input) now throws before the existing if (doc == null) return; guard. That surfaces as an uncaught application exception, which Cypress turns into a failed test (flux-page.cy.js), failing the whole suite.

Fix

  • Wrap the jsyaml.load() call in try/catch and treat empty/comment-only (or malformed) input as "no document" — restoring the pre-5.x behavior and also hardening against bad user YAML.
  • Broaden cypress-tests.yml to also trigger on 2.x.

Note on 2.x

2.x already merged js-yaml 5.2.0 (#8863) and carries the identical latent bug — its cypress-e2e never ran because the workflow was scoped to master only. A companion PR applies the same flux.html fix to 2.x.

Once this lands, #8855 can be rebased to pick up the fix and go green.

dependabot Bot and others added 2 commits July 1, 2026 14:41
Bumps `netty-tcnative.version` from 2.0.77.Final to 2.0.80.Final.

Updates `io.netty:netty-tcnative` from 2.0.77.Final to 2.0.80.Final
- [Release notes](https://github.com/netty/netty-tcnative/releases)
- [Commits](netty/netty-tcnative@netty-tcnative-parent-2.0.77.Final...netty-tcnative-parent-2.0.80.Final)

Updates `io.netty:netty-tcnative-boringssl-static` from 2.0.77.Final to 2.0.80.Final
- [Release notes](https://github.com/netty/netty-tcnative/releases)
- [Commits](netty/netty-tcnative@netty-tcnative-parent-2.0.77.Final...netty-tcnative-parent-2.0.80.Final)

---
updated-dependencies:
- dependency-name: io.netty:netty-tcnative
  dependency-version: 2.0.80.Final
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: io.netty:netty-tcnative-boringssl-static
  dependency-version: 2.0.80.Final
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
js-yaml 5.x 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, surfacing as an uncaught exception that fails the
cypress-e2e suite (flux-page.cy.js).

Wrap the load in try/catch and treat empty/comment-only or malformed
input as 'no document'. Also broaden cypress-tests.yml to run on 2.x so
this class of webapp regression is exercised there too (2.x already
shipped js-yaml 5.2.0 and carries the same latent bug).
@rzo1 rzo1 added this to the 3.0.0 milestone Jul 1, 2026
@rzo1 rzo1 changed the base branch from master to dependabot/npm_and_yarn/storm-webapp/js-yaml-5.2.0 July 1, 2026 13:44
@rzo1 rzo1 changed the base branch from dependabot/npm_and_yarn/storm-webapp/js-yaml-5.2.0 to master July 1, 2026 13:44
@rzo1 rzo1 changed the base branch from master to dependabot/npm_and_yarn/storm-webapp/js-yaml-5.2.0 July 1, 2026 13:45
@rzo1 rzo1 merged commit e2aba7e into dependabot/npm_and_yarn/storm-webapp/js-yaml-5.2.0 Jul 1, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant