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

   ## Summary
   - Extract an exported `auditTimestamp()` helper that maps unparseable audit 
timestamps to `0` (same convention as `toStoreTimestamp` in `api/message.ts`)
   - Use it in the audit log time column sorter so `NaN` no longer leaks into 
the comparison
   - In `cleanupAuditLogs` (mock mode), keep records whose timestamp cannot be 
parsed instead of deleting them
   - Add regression tests for the helper and the cleanup behavior
   
   ## Why
   When a `timestamp` value is unparseable, `new Date(...).getTime()` yields 
`NaN`. In the column sorter, `NaN` compared against real numbers makes every 
comparison `false`, so table sorting becomes nondeterministic for rows with bad 
timestamps. In `cleanupAuditLogs`, `NaN >= cutoff` is always `false`, so 
undated rows were silently deleted together with genuinely old rows — an audit 
record disappears without ever being dated.
   
   ## Testing
   - `./node_modules/.bin/vitest run src/pages/ops/__tests__/AuditPage.test.tsx 
src/services/opsService.test.ts` → 20 passed
   - `./node_modules/.bin/tsc --noEmit` → clean
   - `./node_modules/.bin/eslint src/pages/ops/audit.tsx 
src/services/opsService.ts src/pages/ops/__tests__/AuditPage.test.tsx 
src/services/opsService.test.ts` → 0 errors
   


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