Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Watch and compare route before re-invoking fetch() in ResourceDetail #12278

Merged
merged 1 commit into from
Oct 16, 2024

Conversation

rak-phillip
Copy link
Member

@rak-phillip rak-phillip commented Oct 16, 2024

Summary

This resolves an issue that was preventing the detail page from rendering. #12237 introduced a change that would prevent errors from being thrown if fetch() was invoked against a route without any keys in its query - a use case that was required for navigating between tabs in edit views.

This fix attempts to address a change in timing between route watchers and component unmounting by slightly modifying the approach taken in #12237 by watching the route and only allowing fetch() to re-invoke if the route hasn't changed. The differences observed appear to be related to:

  • Vue2: Component unmounts before the route watcher invokes
  • Vue3: Watcher triggers before the component unmounts, potentially raising unhandled exceptions during navigation between pages & tabs

Fixes #12267
Fixes #12275

Occurred changes and/or fixed issues

  • watch $route instead of $route.query in ResourceDetail
  • assert that $route.name hasn't changed before invoking fetch()

Areas or cases that should be tested

This modifies fetch() behavior for all edit components. Navigation between edit pages and tabs needs to be tested.

Areas which could experience regressions

Navigation and data fetching for edit components.

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

@rak-phillip rak-phillip added this to the v2.10.0 milestone Oct 16, 2024
@rak-phillip rak-phillip self-assigned this Oct 16, 2024
@rak-phillip rak-phillip merged commit 7f4b0f9 into rancher:master Oct 16, 2024
42 checks passed
@rak-phillip rak-phillip deleted the bugfix/12267-detail-view branch October 16, 2024 22:44
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.

User Details view not accessible Clusters: Detail View: Detail button is unresponsive
2 participants