Skip to content

fix(ids): don't crash on properties without data; match any value of list, bounded, enumerated and table properties - #828

Merged
agviegas merged 1 commit into
ThatOpen:mainfrom
helenkwok:fix/ids-property-value-kinds
Oct 11, 2026
Merged

agviegas merged 1 commit into
ThatOpen:mainfrom
helenkwok:fix/ids-property-value-kinds

Conversation

@helenkwok

Copy link
Copy Markdown
Contributor

Fixes #827.

  • IDSProperty: every Name / _category read is guarded, so a property the importer didn't write (a stub item without data) counts as missing instead of throwing.
  • getValueKey is replaced by getValueAttrs / getValues, which collect every value attribute of a property (NominalValue, ListValues, LowerBoundValue / UpperBoundValue / SetPointValue, EnumerationValues, DefiningValues / DefinedValues, quantity values). evalValue passes when any value matches (keeping the numeric-to-string alignment from IDS wrong auto conversion #731), and evalDataType when any value's type matches. Each records one check through addCheckResult.
  • The commented-out list/enumeration code and the "not supported yet" notes are removed, since this covers them.

This touches Property.ts like #822 (cardinality); whichever lands second needs a rebase.

Test

New fixture tests/fixtures/property-values.ifc (written for this test: one wall, one property set with a list, a bounded, an enumerated and a table property, in metres) and facets/property-values.test.ts:

  • with the default importer, the four properties fail as missing and nothing throws;
  • with the importer keeping those classes (importer.classes.abstract.add(...)), a value matches when any of the property's values matches (list, lower / upper / set point, enumerated values but not the rest of the enumeration, defining and defined values), and dataType is checked.

Results:

What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following:

  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Follow the Conventional Commits v1.0.0 standard for PR naming (e.g. feat(examples): add hello-world example).
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

…list, bounded, enumerated and table properties
@helenkwok

Copy link
Copy Markdown
Contributor Author

A note for merging this together with #822: #822 gives evalRequirement a cardinality argument that defaults to the facet's own cardinality. With both, the two new any-value calls in evalValue / evalDataType need "required" passed explicitly (this.evalRequirement(value, parameter, "Value", undefined, "required")), as #822 does for the other per-value checks. I merged the six IDS PRs (#814, #816, #818, #820, #822, #824) and this one locally that way: all IDS tests pass, and buildingSMART's 182 test cases go from 133 agreeing (21 throwing) on main to 148 (0 throwing), 153 with ThatOpen/engine_fragment#324, with no case regressing.

@agviegas
agviegas merged commit 9b38c87 into ThatOpen:main Oct 11, 2026
1 check 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.

IDS: property facet throws on properties without data (19 official test cases), and list, bounded, enumerated and table values are not checked

2 participants