Repository navigation
fix(core): root Objects have parentId null (conformance EXP-15) - #4
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 ConfigurationObject of a historized Variable that sits directly in a folder has no Object ancestor, butparentIdOfcorrectly 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 havingparentId === nullalways 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.