Skip to content

Resolve inherited components when collecting query rows - #60

Merged
HexDecimal merged 1 commit into
HexDecimal:mainfrom
antonsoo:fix/query-inherited-components
Oct 15, 2026
Merged

HexDecimal merged 1 commit into
HexDecimal:mainfrom
antonsoo:fix/query-inherited-components

Conversation

@antonsoo

Copy link
Copy Markdown
Contributor

After a prefab gets a component and a child is created with instantiate(), registry.Q.all_of(components=[int]) finds both entities. Collecting the same component with registry.Q[Entity, int] raises KeyError for the child because row collection reads only direct component storage.

Keep the direct-storage path for ordinary columns and fall back to entity component access for columns containing inherited values. Add regressions for named and unnamed components, inherited None, nested instances, overrides, removal and repeated columns, plus a changelog note.

Validation: 84 tests pass with two existing XPASS results; strict mypy and applicable pre-commit hooks pass. In 32 simulated game-turn workflows checked against a separate plain-dictionary world, all 24 previously failing inherited-component scenarios complete. Eight direct-component controls are unchanged. Save/load and live prefab updates are included.

@codecov

codecov Bot commented Oct 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.16%. Comparing base (2cd1b19) to head (e11545b).

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #60   +/-   ##
=======================================
  Coverage   99.16%   99.16%           
=======================================
  Files           9        9           
  Lines         956      959    +3     
=======================================
+ Hits          948      951    +3     
  Misses          8        8           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@HexDecimal
HexDecimal merged commit e5f0292 into HexDecimal:main Oct 15, 2026
14 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.

2 participants