unbridled-41 commented on PR #5071:
URL:
https://github.com/apache/rocketmq-dashboard/pull/5071#issuecomment-5813354436
### Verification pass (evidence audit, 2026-09-24)
Fresh checkout of this branch (`/tmp/aud-e`); every `file:line` re-read
against base `a562601d` and the branch; every command re-executed there; the
pre-fix claim reproduced by writing the base content of `alerts.tsx` back
(keeping the tests).
**Citations — all hold**
| Claim | base `a562601d` |
|---|---|
| the raw conversion | `alerts.tsx:133` — `` return `${rule.operator}
${rule.threshold * 100}%`; `` inside the branch at `:131-132`
(`nativeRatioMetrics.has(rule.metric) && !rule.thresholdUnit`) |
| the helper the branch calls | `:125` `export const
formatThresholdCondition` |
| the second conversion site | `:485` — `form.setFieldValue('threshold',
Number(form.getFieldValue('threshold')) * 100)` |
| the surface that renders it | `:679` — `render: (_, record) =>
formatThresholdCondition(record, …)` |
| the existing test that hid it | `AlertsPage.test.tsx:273-282` — 0.85, the
one fixture value where `0.85 * 100` is exactly 85 |
| the state is accepted by the API | `AlertRuleRequestDTO.java:38`
(`thresholdUnit`, unconstrained) and `NativeAlertMetricCatalogService.validate`
`:70-85` (checks instance support only, no metric↔unit coupling) |
| the transfer path preserves it | `AlertRuleTransferService.java:71` —
`request.setThresholdUnit(rule.getThresholdUnit())` |
| the risk sentence's dependency |
`AlertRuleSemanticFingerprint.normalizedThreshold` `:64-69` — divides by 100
only when the unit is `%` |
**"5 pre-existing warnings" is verified, not assumed**: running eslint on
the *base* content of the same two files yields the same five warnings and 0
errors (two `react-refresh/only-export-components` on the two exported helpers,
one `react-hooks/exhaustive-deps`, two unused destructured variables).
**Pre-fix reproduction** (command as written, base `alerts.tsx`, branch
tests):
```
AssertionError: expected '> 55.00000000000001%' to be '> 55%' // Object.is
equality
TestingLibraryElementError: Unable to find an element with the text: > 55%.
AssertionError: expected { id: 99, …(18) } to match object { threshold: 55,
thresholdUnit: '%' }
Test Files 1 failed (1) / Tests 3 failed | 28 passed (31)
```
The third line is the one that makes this more than a display bug: the
edited rule's *saved payload* carried the float tail.
**Post-fix**: `Tests 31 passed (31)`, `tsc --noEmit` exit 0, eslint 0 errors.
**Coverage**: both conversion sites are asserted — the table cell (page
render) and the value the edit form saves (the `updateAlertRule` argument) —
plus both rounding directions (0.55 rounds up, 0.29 rounds down). The remaining
consumer of a ratio is the sample *preview* (`previewValueForMetric`), which
does not convert the stored threshold and is untouched by the fix.
**Commit hygiene**: `git show --stat feece0ed` = the page + its test.
No description defect, no test gap and no code defect found in this pass;
nothing was added.
--
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]