Fix wildcard queries for dontFragment relations#5
Merged
Conversation
…onents Co-authored-by: codehz <13158903+codehz@users.noreply.github.com>
- Added hasRelationWithComponentId method to Archetype to check for relations including dontFragment - Updated getMatchingArchetypes to use new method for wildcard relation filtering - Modified Query.getEntities to filter entities with wildcard relations at entity level for dontFragment components - Enhanced buildWildcardRelationValue to include dontFragment relations in iteration - Added comprehensive tests for wildcard queries with dontFragment components Co-authored-by: codehz <13158903+codehz@users.noreply.github.com>
- Add null safety check for wildcard relation results in Query.getEntities - Improve error message with component ID and entity ID for better debugging Co-authored-by: codehz <13158903+codehz@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix wildcard query failure for dontFragment component
Fix wildcard queries for dontFragment relations
Nov 24, 2025
Owner
|
@copilot getMatchingArchetypes 的改动存在问题:由于dont fragment component 的变化不会影响archetype的shape,因而当entity添加这种组件时不会在后续触发 checkNewArchetype,这导致这个写法可能错误的提前过滤了archetype,query可能会漏了这部分实体 |
Copilot stopped work on behalf of
codehz due to an error
November 24, 2025 02:23
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.
Wildcard relation queries like
relation(ChildOf, '*')failed to match entities when the component haddontFragment: true. This occurred because dontFragment relations are stored separately from archetype signatures to prevent fragmentation, but wildcard matching only checked archetype component types.Changes
hasRelationWithComponentId()to check both archetype components and per-entity dontFragment relationsQuery.getEntities()to filter at entity level for wildcard queries, since dontFragment archetypes can contain entities with/without the relationbuildWildcardRelationValue()to include dontFragment relations when iterating withforEach()Example
Original prompt
Created from VS Code via the GitHub Pull Request extension.
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.