Skip to content

fix: resolve undefined cluster context in navigation - #639

Merged
undera merged 2 commits into
komodorio:mainfrom
Suhas-098:fix/frontend-undefined-cluster-route
Jan 5, 2026
Merged

undera merged 2 commits into
komodorio:mainfrom
Suhas-098:fix/frontend-undefined-cluster-route

Conversation

@Suhas-098

Copy link
Copy Markdown
Contributor

Changes Proposed

Description
This PR addresses the issue where navigating to the "Installed" tab after adding a new repository resulted in a broken URL path: /#/undefined/installed/.

The Problem: The application was failing to persist or retrieve the active cluster context during the redirect from the repository addition view back to the main dashboard. This caused the frontend to default the cluster segment of the route to undefined.

The Fix: I modified the navigation component to ensure the cluster variable is correctly sourced from the global state or the current context before constructing the redirect URL.
Added a fallback mechanism so that if a specific cluster is not found in the immediate route params, it defaults to the currently active cluster rather than becoming undefined.

image

Check List

  • The title of my pull request is a short description of the changes
  • This PR relates to some issue:
  • I have documented the changes made (if applicable)
  • I have covered the changes with unit tests

Important Note
"I manually verified the logic in the source code. I attempted to run a local build via Docker to record a video, but encountered environment-specific errors on my local Windows machine. I am relying on the CI/CD pipeline here to verify the build integrity."

@undera undera left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please add encodeURIComponent() for context in URL, to avoid breaking on weird context names

@undera

undera commented Jan 5, 2026

Copy link
Copy Markdown
Collaborator

Also mind the static failure (prettier)

@Suhas-098

Copy link
Copy Markdown
Contributor Author

I've updated Repository.tsx to wrap the context variable in encodeURIComponent() to ensure safe URL navigation with various cluster names. I also resolved the formatting issues locally using Prettier. All checks are now passing and the PR is ready for your review

@undera
undera merged commit 9f07cea into komodorio:main Jan 5, 2026
4 checks passed
@undera

undera commented Jan 5, 2026

Copy link
Copy Markdown
Collaborator

Very nice! Thank you!

@Suhas-098

Copy link
Copy Markdown
Contributor Author

No problem at all, the pleasure is mine! I’m happy I could help improve the project. If any other issues come up or if there’s anything else that needs a fix, please feel free to reach out—I’d be glad to help again

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.

2 participants

⌂ 换网址