Skip to content

fix(core): root Objects have parentId null (conformance EXP-15) - #4

Merged
erossignon merged 1 commit into
mainfrom
fix/root-objects-parentid
Oct 26, 2026
Merged

erossignon merged 1 commit into
mainfrom
fix/root-objects-parentid

Conversation

@erossignon

Copy link
Copy Markdown
Member

Symptom: the i3X conformance suite warns on EXP-15 against opc.tcp://opcuademo.sterfive.com:26541: "52 root Object(s) carry a non-null parentId (e.g. "instance-fb44d6b2547fd640" → "property-1cea426873c01152"); roots should have parentId null."

Cause: an instance counted as a root when it had no Object ancestor. The HA Configuration Object of a historized Variable that sits directly in a folder has no Object ancestor, but parentIdOf correctly returns its Variable, so it was a root that still had a parent.

Fix: roots are derived from childrenById (instances nobody lists as a child), so being a root and having parentId === null always go together.

Test: model-service.test.ts "an Object under a top-level Variable is not a root (conformance EXP-15)". Without the fix the HA Configuration shows up as a second root.

Checked with a local run against the demo server: 32 roots, 0 with a parentId. All 69 HA Configuration objects are still listed under their Variable.

Caveat: the root count on that server drops from 84 to 32. That is intended, but clients that browsed the HA Configuration objects as roots will now reach them through their Variable instead.

GET /objects?root=true returned Objects with a non-null parentId: an
instance counted as root when it had no Object ancestor, but an Object
under a top-level Variable (the HA Configuration of a historized
variable) has that Variable as parent. On opcuademo:26541 that made 52
of 84 roots carry a parentId.

Derive roots from childrenById instead, so root <=> parentIdOf === null.
The HA Configuration objects stay reachable as children of their Variable.
@erossignon
erossignon merged commit e9dae6f into main Oct 26, 2026
2 checks passed
@erossignon
erossignon deleted the fix/root-objects-parentid branch October 26, 2026 08:17
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