Skip to content
This repository has been archived by the owner on Mar 13, 2023. It is now read-only.

Fix react query updates #248

Merged
merged 3 commits into from
Aug 4, 2022
Merged

Fix react query updates #248

merged 3 commits into from
Aug 4, 2022

Conversation

mtfranchetto
Copy link
Contributor

Description

This PR resolves an issue emerged from #219 where a user might not get a clusters list update when a region is changed. This happens because when you switch the region, react-query is not informed that the change happened, and the user still sees the old data.

Changes

  • invalidate all queries state when a region is changed
  • refactored part of the clusters list to poll the list status by leveraging react-query
  • removed a side effect from the clusters list update function that might cause unwanted navigation on a cluster update

How Has This Been Tested?

  • created a new cluster and verified that is selected
  • deleted the cluster and verified that becomes unselected

PR Quality Checkilst

  • I added tests to new or existing code
  • I removed hardcoded strings and used our i18n solution instead (see here)
  • I checked that npm run build builds without any error
  • I checked that clusters are listed correctly
  • I checked that a new cluster can be created (config is produced and dry run passes)
  • I checked that login and logout work as expected

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@mtfranchetto mtfranchetto requested a review from mendaomn August 4, 2022 12:12
mendaomn
mendaomn previously approved these changes Aug 4, 2022
@mtfranchetto mtfranchetto merged commit b9faa09 into main Aug 4, 2022
@mtfranchetto mtfranchetto deleted the fix-react-query-updates branch August 4, 2022 13:33
rkilpadi pushed a commit to rkilpadi/pcluster-manager that referenced this pull request Aug 4, 2022
* Invalidate all queries when the region is changed

* Fix clusters list displayed during updates

* Add tests for clusters update
@BarcoMasile BarcoMasile added the release:feature Contains features to include in the changelog label Nov 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release:feature Contains features to include in the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants