Skip to content

[BUG] NamespacePluginServiceImpl.create never publishes a sync event; new namespace-plugin relation never reaches the gateway #6537

Description

@Aias00

Description

create inserts NamespacePluginRelDO and returns, but never calls namespacePluginEventPublisher.onCreated(vo). The publisher's onCreated (line 63) publishes both DataChangedEvent(PLUGIN, CREATE) for gateway sync and a NamespacePluginCreatedEvent for audit — it is simply never invoked from create. Every other mutating method in this service publishes (update->onUpdated, delete->onDeleted, enabled->onEnabled).

Location

shenyu-admin/.../service/impl/NamespacePluginServiceImpl.java:94-103
namespacePluginEventPublisher.onCreated at NamespacePluginEventPublisher.java:63

Impact

A plugin added to a namespace via POST /namespace-plugin/{namespaceId}/{pluginId} is saved in the admin DB but never pushed to the bootstrap/gateway. The plugin is not active in that namespace until a manual syncPluginAll/syncPluginData is invoked. No audit log entry is created either.

Suggested fix

After insertSelective, fetch the VO via selectByPluginIdAndNamespaceId(pluginId, namespaceId) and call namespacePluginEventPublisher.onCreated(vo).

Related existing issue(s)

None

Identified during the 2026-08-02 audit; full list in docs/issue-candidates-2026-08-02.md.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions