konveyor / tackle2-ui

Tackle (2nd generation) UI component.
Apache License 2.0
8 stars 43 forks source link

:bug: Remove unnecessary initialData from useQuery calls #1940

Closed rszwajko closed 5 months ago

rszwajko commented 5 months ago

Initial data is persisted in cache which results in:

  1. isLoading flag always false
  2. with custom staleTime, delaying first fetch until cache expires
codecov[bot] commented 5 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 42.17%. Comparing base (b654645) to head (32e9679). Report is 154 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1940 +/- ## ========================================== + Coverage 39.20% 42.17% +2.97% ========================================== Files 146 166 +20 Lines 4857 5318 +461 Branches 1164 1293 +129 ========================================== + Hits 1904 2243 +339 - Misses 2939 3059 +120 - Partials 14 16 +2 ``` | [Flag](https://app.codecov.io/gh/konveyor/tackle2-ui/pull/1940/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=konveyor) | Coverage Δ | | |---|---|---| | [client](https://app.codecov.io/gh/konveyor/tackle2-ui/pull/1940/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=konveyor) | `42.17% <100.00%> (+2.97%)` | :arrow_up: | | [server](https://app.codecov.io/gh/konveyor/tackle2-ui/pull/1940/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=konveyor) | `?` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=konveyor#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

rszwajko commented 5 months ago

@sjd78 @ibolton336 The bug was found when testing #1939 - isFetchingApplications was always false which breaks the the linking functionality.

Btw note that we use a different meaning of isFetching then React Query - under the hood it's translated to isLoading (which is a different state).