[BUG] PluginServiceImpl.importData never publishes the create event (resource init skipped for imported plugins)
- Dominant language
- Java
- Stars
- 8.8k
- Forks
- 3.1k
- Avg merge
- 7d 1h
- Merged PRs (30d)
- 85
Description
- severity: High
- files: `shenyu-admin/src/main/java/org/apache/shenyu/admin/service/impl/PluginServiceImpl.java:257-274`
- description: In the import loop, after `pluginMapper.insertSelective(pluginDO) > 0`, the comment says `// publish create event. init plugin data`, but unlike the normal `create()` path (line 299-302 which calls `pluginEventPublisher.onCreated(pluginDO)`), the import path only increments `successCount` and never calls `pluginEventPublisher.onCreated`. So `ResourceServiceImpl.onPluginCreated` is never triggered for imported plugins.
- impact: Plugins imported via config import are persisted but their plugin-resource/permission initialization is silently skipped, leaving them in a half-initialized state.
- suggested_fix: Add `pluginEventPublisher.onCreated(pluginDO);` inside the `if (pluginMapper.insertSelective(pluginDO) > 0)` block.
- confidence: High
- related_existing: none. FUNC-A1/#6537 is about NamespacePluginServiceImpl.create, not PluginServiceImpl.importData.
---
_Identified during the 2026-08-02 deep re-scan; full list in [`docs/scan2-2026-08-02/00-consolidated-critical-high.md`](docs/scan2-2026-08-02/00-consolidated-critical-high.md)._
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in shenyu-admin/src/main/java/org/apache/shenyu/admin/service/impl/PluginServiceImpl.java at importData lines 257-274, then compare the normal create() path at lines 299-302. Verify that a successfully imported plugin follows the same event-publication behavior and that plugin resource and permission initialization is no longer skipped.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 86/100