Skip to content

Unparsable .esdm.yaml files are dropped silently #4

Description

@goloroden

Found while modeling a real domain in ESDM and browsing it with the visualizer.

readYamlFile() in src/lib/server/esdm-loader.ts wraps yaml.loadAll() in a try whose catch returns []. A file that fails to parse therefore contributes nothing to the model, and nothing anywhere says so.

Because a single file may hold many manifests, one typo now costs the whole file rather than a single document.

Reproducing it

  1. Take examples/shop and move the nine ordering documents into one commands.esdm.yaml, separated by ---.
  2. Break the indentation of one of them, for example by adding a stray key under name:.
  3. Reload the board.

All nine commands disappear. The actors, events, read models and queries stay, so the board still looks like a plausible model, just one in which nothing can happen.

Measured on a model of 30 manifests across 8 files: breaking a single manifest inside a 9-manifest file took the board from 27 nodes to 18, with no message in the UI and nothing on the console.

Suggestion

Keep the per-file failure instead of discarding it, and surface it somewhere in the UI, for instance a banner naming the files that could not be read. Silently rendering an incomplete model is the one outcome that cannot be noticed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions