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

   ### Which Issue(s) This PR Fixes
   
   Fixes #6923.
   
   ### Brief Description
   
   `canConvertToInt()` plus `asInt() == 0` accepts a nonzero fractional 
DingTalk `errcode` such as `0.5`; the default floating parser also underflows 
`1e-400` to zero. Both the test-notification entry point and queued delivery 
can therefore report success for these unexpected responses.
   
   Read response fractions as BigDecimal and require a numeric zero without 
narrowing. The existing acceptance of `0`, `0.0` and signed zero remains. This 
is defensive handling of abnormal responses: there is no evidence that real 
DingTalk emits fractional error codes. Request signing, URI encoding, SMS 
handling and the retry state machine are unchanged. AI assistance was used for 
investigation, implementation and verification.
   
   ### How Did You Test This Change?
   
   Linux ECS, JDK 21 / Maven 3.9.14, based on 
`c34535db0819d02f68e50a856cb3d2614f0dc5dd`. Commands run from `server/` with 
the existing Maven dependency cache and mirror:
   
   - RED: restore the base notification service and run `mvn -B -ntp 
-Dtest=NotificationDingTalkResponseTest test`: 28 cases, 8 assertion failures, 
0 errors. Nonzero positive/negative fractions and underflow values fail through 
both entry points.
   - GREEN: restore the fix and run `mvn -B -ntp 
-Dtest=NotificationDingTalkResponseTest,NotificationOutboxServiceTest,NotificationWebhookEncodingTest
 test`: 74 tests, 0 failures/errors/skips.
   - `mvn -B -ntp clean package -DskipTests`: passed, including Checkstyle, 
compilation of all main/test sources and the packaged dependency license gate.
   - `git diff --check`: passed.
   
   The 28 new cases exercise the real RestTemplate with MockRestServiceServer 
and mock persistence. Controls include numeric zero forms, ordinary and large 
integer errors, missing/null/string codes and invalid JSON. No live DingTalk, 
MySQL or Broker was contacted. The full backend test suite is left to CI; these 
local checks do not claim to run it.
   
   ### Checklist
   
   - [x] One coherent change
   - [x] Conventional Commit subject
   - [x] Regression tests named `...Test`
   - [x] No UI text changes
   - [x] New source carries the ASF header
   - [x] Related notification documentation updated
   


-- 
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