Skip to content

Conversation

@richard-cox
Copy link
Member

@richard-cox richard-cox commented Sep 5, 2025

Summary

Fixes #15330

Occurred changes and/or fixed issues

  • the cache can represent all resources, resources from a specific namespace, resources in a paginated list or resources relevant to a specific labelSelector
  • if we load a resource into cache it can invalidate these. we only specifically invalidate when the store represents resources in a paginated list (where adding a resource to the cache would look like it was in the current page
  • change is to avoid invalidating the page cache state if we're saving a resource from a model
    • Most likely either
      • The resource came from a list already (loaded resource is already in the page that is in the cache)
      • UI is not on a page with a list (cache doesn't represent a list)

Technical notes summary

  • this is done generically, which avoids explictely setting invalidatePageCache on every save that could be affected (like in shell/dialog/RedeployWorkloadDialog.vue

Areas or cases that should be tested

  • deployments - pause, resume, redeploy
  • cronjob - suspend, resume

Areas which could experience regressions

  • there's quite a few places we call model save (~145) but tracking down a specific case where this could be broken is hard

Checklist

  • The PR is linked to an issue and the linked issue has a Milestone, or no issue is needed
  • The PR has a Milestone
  • The PR template has been filled out
  • The PR has been self reviewed
  • The PR has a reviewer assigned
  • The PR has automated tests or clear instructions for manual tests and the linked issue has appropriate QA labels, or tests are not needed
  • The PR has reviewed with UX and tested in light and dark mode, or there are no UX changes
  • The PR has been reviewed in terms of Accessibility

@richard-cox richard-cox added this to the v2.13.0 milestone Sep 5, 2025
@richard-cox richard-cox self-assigned this Sep 5, 2025
@richard-cox richard-cox marked this pull request as ready for review September 5, 2025 13:45
@richard-cox richard-cox requested a review from torchiaf September 5, 2025 13:45
Copy link
Member

@torchiaf torchiaf left a comment

Choose a reason for hiding this comment

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

I could reproduce the bug by clicking on "Redeploy" action multiple times.
The resources in the table are likely losing updates sync after the first click, since the UI gets a conflict error after that and the table ends up being cleared.

Screencast.from.2025-09-10.18-50-14.webm

@richard-cox
Copy link
Member Author

@torchiaf would you be able to give this one a re-review? thanks

Copy link
Member

@torchiaf torchiaf left a comment

Choose a reason for hiding this comment

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

I can't reproduce the bug anymore. LGTM

@richard-cox richard-cox merged commit be6e6c9 into rancher:master Oct 15, 2025
113 of 118 checks passed
@richard-cox richard-cox deleted the pagination-list-clear-on-save branch October 15, 2025 10:42
@richard-cox
Copy link
Member Author

/backport v2.12.5 release-2.12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Workloads - empty tables on action clicks

2 participants