Skip to content

Fix MCP server Runtime page crash when an endpoint is removed#1371

Merged
RakhithaRR merged 3 commits into
wso2:mainfrom
Saadha123:fix/mcp-runtime-missing-endpoint-crash
Jul 13, 2026
Merged

Fix MCP server Runtime page crash when an endpoint is removed#1371
RakhithaRR merged 3 commits into
wso2:mainfrom
Saadha123:fix/mcp-runtime-missing-endpoint-crash

Conversation

@Saadha123

@Saadha123 Saadha123 commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Purpose

Fixes the crash that occurs when navigating to the Runtime page of an MCP server after deleting either the production or sandbox endpoint.

Changes

  • The Runtime page threw TypeError: Cannot read properties of undefined (reading 'url') because showEndpoint() in Endpoints.jsx accessed .url directly on
    endpointConfig.production_endpoints / endpointConfig.sandbox_endpoints without checking if the object exists.
  • Added null guards so that a missing endpoint returns undefined instead of throwing, which the existing JSX already handles by rendering a blank placeholder (-).
image

Related Issues

Fixes wso2/api-manager#5096

@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 0f161bb2-34fc-4d35-93b6-34f008596327

📥 Commits

Reviewing files that changed from the base of the PR and between dcebdc5 and 84cbe25.

📒 Files selected for processing (1)
  • portals/publisher/src/main/webapp/source/src/app/components/Apis/Details/Configuration/components/Endpoints.jsx

📝 Walkthrough

Walkthrough

Endpoints.jsx now safely handles missing MCP production or sandbox endpoint objects and defines the expected nullable endpointConfig prop shape.

Changes

Null-safe endpoint configuration handling

Layer / File(s) Summary
Endpoint access and prop contract
portals/publisher/src/main/webapp/source/src/app/components/Apis/Details/Configuration/components/Endpoints.jsx
MCP endpoint URLs use optional chaining, and endpointConfig validation now describes optional production and sandbox URL fields with a null default.

Estimated code review effort: 1 (Trivial) | ~2 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: preventing the Runtime page crash when an endpoint is removed.
Description check ✅ Passed The description directly explains the crash and the null-guard fix in Endpoints.jsx.
Linked Issues check ✅ Passed The change addresses issue #5096 by guarding missing production and sandbox endpoints so Runtime no longer crashes.
Out of Scope Changes check ✅ Passed The edits are limited to the crash fix and related prop validation/defaults, with no obvious unrelated changes.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

coderabbitai[bot]
coderabbitai Bot previously approved these changes Jun 22, 2026
@sonarqubecloud

Copy link
Copy Markdown

@RakhithaRR

Copy link
Copy Markdown
Contributor

@coderabbitai approve

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Comments resolved. Approval is disabled; enable reviews.request_changes_workflow to allow explicit top-level @coderabbitai resolve or @coderabbitai approve commands.

@RakhithaRR
RakhithaRR merged commit d672b50 into wso2:main Jul 13, 2026
4 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.

Runtime View Fails When Sandbox or Production Endpoint Is Removed in MCP server

2 participants