[BUG] AlertReceiverServiceImpl.updateReceiver uses full updateByPrimaryKey, nulling omitted columns
- Dominant language
- Java
- Stars
- 8.8k
- Forks
- 3.1k
- Avg merge
- 7d 1h
- Merged PRs (30d)
- 85
Description
- severity: Medium
- files: `shenyu-admin/src/main/java/org/apache/shenyu/admin/service/impl/AlertReceiverServiceImpl.java:78-82`
- description: `updateReceiver` maps the DTO via `AlertTransfer.INSTANCE.mapToAlertReceiverDO` and calls `alertReceiverMapper.updateByPrimaryKey(receiverDO)` (full column update). Any DTO field not populated becomes NULL (e.g. `namespaceId`, `levels`, `labels`, `matchAll`, `enable`, `config`).
- impact: Partial PUT payloads silently wipe receiver configuration, which can disable alerting or change matching scope.
- suggested_fix: Switch to `updateByPrimaryKeySelective(receiverDO)`, or require full DTO on update.
- confidence: Medium
- related_existing: none.
---
_Identified during the 2026-08-02 deep re-scan; full list in [`docs/scan2-2026-08-02/06-medium-tiers.md`](docs/scan2-2026-08-02/06-medium-tiers.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/AlertReceiverServiceImpl.java:78-82 and inspect updateReceiver, the DTO mapping, and mapper call. Verify how a partial PUT is handled, then change the update behavior as proposed so omitted fields are preserved. Done means partial updates no longer null namespaceId, levels, labels, matchAll, enable, or config.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend, database
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100