Skip to content

Conversation

r04423
Copy link
Contributor

@r04423 r04423 commented Aug 10, 2025

Currently queries containing only Changed modifier pick up changes from (seemingly) any trait, not only the one specified in the query parameter

This PR updates required PR bit flag to include changed, ensuring query behavior stays correct


return {
required: required | added,
required: required | added | changed,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not 100% if it's correct place to fix the issue, but I assumed traits in Changed modifier should be considered as required

entity2.changed(Bar);

// Changed(Foo) should still return undefined
expect(world.queryFirst(Changed(Foo))).toBeUndefined();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This assertion was previously failing


it.fails(
'should not inlcude non-tracked traits in queries contaning only Removed modifier',
() => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can reproduce the same issue with Removed modifier, but here I wasn't entirely sure if the fix would be the same

@r04423 r04423 marked this pull request as draft August 11, 2025 20:28
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