wso2 / wso2/api-platform

WebBrokerAPI: Fix: Include webbroker_apis in GetAllConfigs UNION query

Open
#1,965 0 comments 0 reactions 1 assignee View on GitHub

@senthuran16 is already working on this.

Since May 14, 2026.

Area/EventGateway
Dominant language
Go
Stars
71
Forks
111
Avg merge
1d 14h
Merged PRs (30d)
110

Description

Summary

The GetAllConfigs function in gateway/gateway-controller/pkg/storage/sql_store.go builds a UNION query across all artifact type tables but is missing the webbroker_apis table. This means WebBrokerApi artifacts are saved and retrievable via direct lookup, but are silently omitted from full-list scans and in-memory cache hydration paths.

Impact

Any code path that calls GetAllConfigs (e.g., cache reload on gateway restart) will not return WebBrokerApi configurations, potentially causing stale or incomplete state.

Fix

Add a UNION branch for webbroker_apis in GetAllConfigs, consistent with the existing branches for rest_apis, websub_apis, llm_providers, llm_proxies, and mcp_proxies. Also increment the parameter count passed to s.query.

 		UNION ALL

+			SELECT a.uuid, a.kind, a.handle, a.display_name, a.version, wb.configuration, a.desired_state,
+				a.deployment_id, a.origin, a.created_at, a.updated_at, a.deployed_at,
+				a.cp_sync_status, a.cp_sync_info, a.cp_artifact_id
+			FROM artifacts a
+			JOIN webbroker_apis wb ON a.uuid = wb.uuid AND a.gateway_id = wb.gateway_id
+			WHERE a.gateway_id = ?
+
+		UNION ALL

 			SELECT a.uuid, a.kind, a.handle, a.display_name, a.version, lp.configuration, a.desired_state,

And update the query call:

-	rows, err := s.query(query, s.gatewayId, s.gatewayId, s.gatewayId, s.gatewayId, s.gatewayId)
+	rows, err := s.query(query, s.gatewayId, s.gatewayId, s.gatewayId, s.gatewayId, s.gatewayId, s.gatewayId)

References

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.