Skip to content

aksd: Remove translation function from effect dependencies#441

Merged
illume merged 1 commit into
Azure:mainfrom
sniok:fix-render-loops
Mar 16, 2026
Merged

aksd: Remove translation function from effect dependencies#441
illume merged 1 commit into
Azure:mainfrom
sniok:fix-render-loops

Conversation

@sniok
Copy link
Copy Markdown
Collaborator

@sniok sniok commented Mar 16, 2026

t function is recreated every render that causes effects that included it in the dependencies to loop

how to test:

  1. Go to project details page
  2. Make sure the are no infinite network requests

Copilot AI review requested due to automatic review settings March 16, 2026 14:02
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses an infinite re-fetch / re-effect loop caused by including the i18n translation function t in React hook dependency arrays, where t appears to change identity between renders in some screens (e.g., project details).

Changes:

  • Removed t from a useEffect dependency array in the Scaling deployments watcher hook.
  • Removed t from a useCallback dependency array used to fetch GitHub repos.
  • Removed t from the elapsed-time interval effect dependencies in the PR status screen.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
plugins/aks-desktop/src/components/Scaling/hooks/useDeployments.ts Stops the deployments watcher effect from being re-created due to t changes.
plugins/aks-desktop/src/components/GitHubPipeline/components/RepoSelector.tsx Prevents repo-fetch callback/effect from re-triggering due to t changes.
plugins/aks-desktop/src/components/GitHubPipeline/components/PRStatusScreen.tsx Prevents the elapsed-time interval effect from restarting due to t changes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread plugins/aks-desktop/src/components/Scaling/hooks/useDeployments.ts
@illume illume merged commit 076878d into Azure:main Mar 16, 2026
16 checks passed
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.

4 participants