Skip to content

Conversation

@DominikB2014
Copy link
Contributor

Previously in the dashboard api hooks we would store query result data in a ref, on rerender of the hook we would compare against that ref to see if data has changed. This works but there's a better way with react query.

Instead we use the combine property of useQueries to maintain ref stability which is less manual and less error prone

@DominikB2014
Copy link
Contributor Author

@cursor review

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jan 30, 2026
Copy link
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

firstError: results.find(q => q?.error)?.error as any,
queryData: results.map(q => q.data),
};
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Duplicate combine functions with only type cast difference

Low Severity

Two nearly-identical functions combineQueryResultsWithFullError and combineQueryResultsWithRequestError have the same logic, differing only in the type cast on firstError (as any vs as RequestError | undefined). These could be consolidated into a single shared utility function that returns firstError: results.find(q => q?.error)?.error and let callers handle typing, reducing duplication and maintenance burden.

Additional Locations (1)

Fix in Cursor Fix in Web

…ueries-reference-stability-in-order-instead-of
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

2 participants