Skip to content

frontend: Notifications: add missing dispatch dep to useEffect#5720

Open
Swastik19Nit wants to merge 1 commit into
kubernetes-sigs:mainfrom
Swastik19Nit:fix/notifications-exhaustive-deps
Open

frontend: Notifications: add missing dispatch dep to useEffect#5720
Swastik19Nit wants to merge 1 commit into
kubernetes-sigs:mainfrom
Swastik19Nit:fix/notifications-exhaustive-deps

Conversation

@Swastik19Nit
Copy link
Copy Markdown

@Swastik19Nit Swastik19Nit commented May 17, 2026

dispatch was used inside the effect but left out of the deps array with an eslint-disable comment. Since dispatch from useDispatch() is stable adding it has no behavior change.

Part of #5183

@k8s-ci-robot k8s-ci-robot requested review from illume and skoeva May 17, 2026 16:09
@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla Bot commented May 17, 2026

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: Swastik19Nit / name: Swastik19Nit (2785c36)

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

Welcome @Swastik19Nit!

It looks like this is your first PR to kubernetes-sigs/headlamp 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/headlamp has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label May 17, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Swastik19Nit
Once this PR has been reviewed and has the lgtm label, please assign illume for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels May 17, 2026
@illume illume requested a review from Copilot May 17, 2026 18:52
Copy link
Copy Markdown
Contributor

@illume illume left a comment

Choose a reason for hiding this comment

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

Thanks for these changes.

Can you please have a look at the git commits to see if they meet the contribution guidelines? We use a Linux kernel style of git commits. See the contributing guide for general context, and please see previous git commits with git log for examples.

Commits that need attention
  • frontend: Notifications: add missing dispatch dep to useEffect — Description must start with a capital letter — e.g. frontend: HomeButton: Fix the button not frontend: HomeButton: fix the button.
Commit guidelines
  • Use atomic commits focused on a single change.
  • Use the title format <area>: <Description of changes> — description must start with a capital letter.
  • Keep the title under 72 characters (soft requirement).
  • Explain the intention and why the change is needed.
  • Make commit titles meaningful and describe what changed.
  • Do not add code that a later commit rewrites; squash or reorder commits instead.
  • Do not include Fixes #NN in commit messages.

Good examples:

  • frontend: HomeButton: Fix so it navigates to home
  • backend: config: Add enable-dynamic-clusters flag

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 removes a suppressed react-hooks/exhaustive-deps warning in the Notifications UI by adding the (stable) Redux dispatch function to a useEffect dependency array, aligning the code with hook dependency expectations without changing runtime behavior.

Changes:

  • Adds dispatch to the useEffect deps array in Notifications.
  • Removes the now-unnecessary eslint-disable for react-hooks/exhaustive-deps.

@Swastik19Nit Swastik19Nit force-pushed the fix/notifications-exhaustive-deps branch from 2785c36 to c1e26e2 Compare May 17, 2026 18:58
@Swastik19Nit
Copy link
Copy Markdown
Author

fixed the commit message capitalization thanks for pointing that out

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

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

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

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants