Instead of relying on the reactive state query parameter with .refetch(), fetch the YAML dynamically#281
Conversation
|
Welcome @aniket866! It looks like this is your first PR to volcano-sh/dashboard 🎉 |
There was a problem hiding this comment.
Code Review
This pull request refactors the fetching of YAML configurations for jobs, pods, and queues by replacing the useQuery hooks with direct fetch calls via TRPC utils inside the row click handlers. It also updates several dependencies in package-lock.json. The reviewer identified usability and potential race condition issues across all three management components (jobs-management.tsx, pod-management.tsx, and queue-management.tsx). Specifically, fetching the YAML before opening the details modal causes UI delays and allows concurrent requests. The reviewer suggested opening the modals immediately with basic details and fetching the YAML in the background.
Signed-off-by: aniket866 <iamaniketkumarmaner@gmail.com>
c4f2e16 to
b91b0d0
Compare
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
@de6p Please review |
Closes #280
Brief Solution
Instead of relying on the reactive state query parameter with
.refetch(), fetch the YAML dynamically on demand using the tRPC context/client cache or by callingfetchdirectly with the clicked row's details in the handler:Why it happens
""(nothing / empty text).Simple Solution
Update the code so it first remembers exactly which job you clicked, and then immediately asks the server for that specific job's details instead of asking for "whatever is currently selected."
@de6p
/review