Skip to content

[BUG] Ad plugin registered api schema conflicts with alerting plugin #1002

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Hailong-am opened this issue Apr 1, 2025 · 0 comments
Closed
Labels
bug Something isn't working untriaged

Comments

@Hailong-am
Copy link
Contributor

Hailong-am commented Apr 1, 2025

What is the bug?

Ad plugin will register a custom api schema alertingPlugin during plugin setup, that have conflict with alerting plugin. They both using same namespace for the api schema.

if (dataSourceEnabled) {
dataSource.registerCustomApiSchema(adPlugin);
dataSource.registerCustomApiSchema(alertingPlugin);
}

AD

const ca = components.clientAction.factory;
Client.prototype.alerting = components.clientAction.namespaceFactory();
const alerting = Client.prototype.alerting.prototype;

Alerting

https://github.com/opensearch-project/alerting-dashboards-plugin/blob/82532860e740d260e281be4656ef47e4bbecf12b/server/clusters/alerting/alertingPlugin.js#L18-L21

By looking at the logic, the api schema may override each other that depends on plugin setup order.

How can one reproduce the bug?
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

What is the expected behavior?
A clear and concise description of what you expected to happen.

What is your host/environment?

  • OS: [e.g. iOS]
  • Version [e.g. 22]
  • Plugins

Do you have any screenshots?
If applicable, add screenshots to help explain your problem.

Do you have any additional context?

This is only happened for multiple datasource case

@Hailong-am Hailong-am added bug Something isn't working untriaged labels Apr 1, 2025
@Hailong-am Hailong-am changed the title [BUG] Ad plugin register [BUG] Ad plugin registered api schema conflicts with alerting plugin Apr 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working untriaged
Projects
None yet
Development

No branches or pull requests

2 participants