Skip to content

Core - Fix data model and event condition bugs found by the tests - #910

Merged
RobertBeekman merged 3 commits into
masterfrom
fix/data-model
Oct 20, 2026
Merged

RobertBeekman merged 3 commits into
masterfrom
fix/data-model

Conversation

@RobertBeekman

@RobertBeekman RobertBeekman commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Fixes the data model and event condition bugs found by the test suite (#907). Each fix flips the test that pinned the old behaviour.

Fixed

  • DataModel.RemoveDynamicChild(child) removes the child. It compared each child's value with the child, so it never removed anything.
  • Removing the dynamic child a path points to makes the path invalid, and adding it back makes the path valid again. Before, the path stayed valid and read a default value.
  • A new DataModelPath is saved right away. The constructors called Save before the path was set up, so nothing was saved and the path didn't follow its data model leaving and returning to the store.
  • IsPropertyInUse(..., includeChildren: true) matches whole path segments. "Integer" no longer counts as in use because of a path to "IntegerList".
  • The fallback type lookup of a data model path also finds types from plugins and SkiaSharp. The type is stored without its assembly, so it's now looked up in all loaded assemblies.
  • An event triggered before an event condition existed no longer plays the layer. This mostly happened when a profile was activated.
  • An event condition watching a plain value no longer plays on the first frame. The first value it sees is taken as the starting point.

Visible change

Layers with an event condition no longer play once when their profile is activated, unless the event actually happens after that.

Testing

  • Artemis.Core.Tests: all passed
  • Artemis.UI.Shared.Tests: 176 passed

…e in use

- DataModel.RemoveDynamicChild compared the value of each child with the
  child that was passed in, so it never removed anything.
- IsPropertyInUse with includeChildren matched paths by their start, so
  a path to "Integers" made "Integer" count as in use. Children are now
  matched on what follows a dot.
…d types

- The constructors saved the path before setting it up, while it was
  still invalid, so a new path stored nothing and didn't follow its data
  model leaving and returning to the store until it was saved.
- Removing the dynamic child a path points to left the path valid and
  reading a default value, it now becomes invalid like when the child
  was never there.
- The stored type of a path is now also looked up in all loaded
  assemblies, Type.GetType only found it in Artemis.Core and the .NET
  libraries, not in plugins or SkiaSharp.
…rt watching

- A trigger from before the condition watched its event, for example
  long before the profile was activated, counted as new and played the
  element once. Triggers now count from the moment the condition starts
  watching its path.
- A condition on a plain value treated the first value it saw as a
  change and played the element on the first frame. The first value is
  now taken as the starting value.
@RobertBeekman
RobertBeekman marked this pull request as ready for review October 20, 2026 11:46
@RobertBeekman
RobertBeekman merged commit 6df81b1 into master Oct 20, 2026
2 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