parseablehq / console

Frontend Client for Parseable. Parseable is a cloud native log storage and management for Kubernetes, containerised workloads
https://parseable.com
GNU Affero General Public License v3.0
25 stars 35 forks source link

Fixed the dashboard tile loading issue (#344) #346

Closed praveen5959 closed 1 month ago

praveen5959 commented 1 month ago

If we use react-query, why'd we still need to perform abort on signal ?

react-query will internally cancel the queries. React Query will stop handling the response from the previous query, but it doesn't automatically cancel the underlying network request.

To explicitly cancel the request over network. I had to use AbortController (or Axios cancelToken) to cancel the pending requests over network to save bandwidth

cc: @balaji-jr

nitisht commented 1 month ago

Leaving it to react query wont do any harm neither does it improve performance by cancelling requests. Please remove the abort controller implementation.

AbortController seems like a cleaner approach here right. Basically it cleanly stops any overhead related to the request. If this doesn't have any overhead, why remove it?

balaji-jr commented 1 month ago

Leaving it to react query wont do any harm neither does it improve performance by cancelling requests. Please remove the abort controller implementation.

AbortController seems like a cleaner approach here right. Basically it cleanly stops any overhead related to the request. If this doesn't have any overhead, why remove it?

@nitisht Why we shouldn't abort a network request: https://tanstack.com/query/latest/docs/framework/react/guides/query-cancellation#default-behavior - Package docs.

In addition to the above ^, We have an abort controller in place for GRPC requests from the console. But for these rest API calls, the backend will still process the call even if we abort.