Skip to content

fix(query): do not invalidate readers when a result does not change - #8

Open
johanrd wants to merge 2 commits into
base/v0.10.0from
fix/query-skip-noop-writes
Open

johanrd wants to merge 2 commits into
base/v0.10.0from
fix/query-skip-noop-writes

Conversation

@johanrd

@johanrd johanrd commented Nov 2, 2026 •

Copy link
Copy Markdown
Owner

useQuery writes loading, data, networkStatus and error for each result, also when a value did not change.
A tracked write always invalidates, so a refetch with an identical result runs every reader again.
This change skips a write when the value is the same.
The compare is in untrack, because writing a field read in the same computation trips the backtracking assertion.
It does not use @tracked({ equals }), because the test matrix still includes Ember 4.12 and 5.4.

Cowritten by Claude

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