yyqdbngt opened a new pull request, #5879:
URL: https://github.com/apache/rocketmq-dashboard/pull/5879

   ## Why
   Two multi-write methods in `MybatisPlusAlertRepository` ran without a Spring 
transaction while the single-write `insertRule` in the same class is 
`@Transactional`:
   
   - `deleteAcknowledgedAlerts` first deletes the notification outbox rows of 
acknowledged alerts, then the alert rows themselves. If the alert delete fails 
in between, the outbox rows are already gone for alerts that still exist — 
their pending retry notifications are silently lost.
   - `replaceRule` follows the main `updateById` with a second write 
(`clearOmittedOptionalColumns`) that nulls optional columns the request 
omitted. A failure between the two writes leaves a half-updated rule whose 
cleared fields silently keep their previous values.
   
   ## What changed
   - Added `@Transactional` to both methods so a failure anywhere rolls every 
write of the method back.
   
   ## Validation
   - Red first: new tests in `MybatisPlusAlertRepositoryTest` asserted the 
annotation is missing and failed (`replaceRule writes the rule twice and must 
be @Transactional`, `deleteAcknowledgedAlerts writes two tables and must be 
@Transactional`); they also verify both writes of each method still execute.
   - After the fix: `mvn test 
-Dtest=MybatisPlusAlertRepositoryTest,AlertServiceTest,SystemAlertControllerTest`
 — all green. (`NativeAlertEvaluationTransactionTest` is a full 
`@SpringBootTest` that needs a live MySQL and fails identically on the 
untouched base branch in this environment.)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to