fix: use the right list of excluded fields in GraphCodec by tbouffard · Pull Request #777 · maxGraph/maxGraph

@tbouffard

Doing an export/encode of a Graph generated an error "Maximum call stack size exceeded. RangeError: Maximum call stack size exceeded".

In `GraphCodec`, the list of excluded fields was incorrect:
  - `selection` was in the list, but this field doesn't exist, it is named `selectionModel`.
  The bug already existed in mxGraph https://github.com/jgraph/mxgraph/blob/v4.2.2/javascript/src/js/io/mxGraphCodec.js#L26
  - `plugins` was missing. There is currently no codec for Plugin so it is not supported for now

Tests have been added to validate that the Graph import/export works.

In all existing tests involving Codecs, unregister all codecs before and after to ensure there is no side effects between tests.

@tbouffard added the bug

Something isn't working

label

Apr 25, 2025

@tbouffard