You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "messere1 (via GitHub)" <gi...@apache.org> on 2026/10/15 11:37:02 UTC

[PR] fix(web): type the audit operator as nullable to repair the tip build [rocketmq-dashboard]

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

   ### Brief Description
   
   `tsc -b` — the first step of `npm run build`, which the Frontend Build CI job runs — currently **fails on the rocketmq-studio tip**:
   
   ```
   src/pages/ops/__tests__/auditRiskInsights.test.ts(193,23): error TS2322: Type 'null' is not assignable to type 'string | undefined'.
   src/pages/ops/__tests__/auditRiskInsights.test.ts(195,23): error TS2322: Type 'null' is not assignable to type 'string | undefined'.
   ```
   
   #6367 (merged today) pinned the missing-operator grouping with rows built as `operator: null`, while `AuditRecord.operator` / `AuditRiskRecord.operator` are declared as bare `string`. The test models the shape the model itself defends against — #6367's grouping fix is built on `record.operator?.trim() || null` and `normalizeText(record.operator, 'system')` — and the backing server column is a nullable Java `String` (`RmqOperationAudit.operator`), so the honest repair is the type, not the test: both interfaces now declare `operator: string | null`.
   
   Every existing consumer is already null-safe (the audit table sorts with `(a.operator ?? '')`, the model uses `.trim()` behind `?.`, and antd renders a null cell empty), so the widening only makes the compiler agree with what the code already handles — and unblocks the Frontend Build check for every open PR against the tip.
   
   ### How Did You Test This Change?
   
   - **Red on unpatched tip**: `npx tsc -b` in `web/` reports the two TS2322 errors above (verified on a clean checkout of 816dcb64). **Green after**: `tsc -b` completes with no output.
   - `auditRiskInsights.test.ts` + `AuditRiskInsights.test.tsx` 16/16 green (the #6367 grouping test passes unchanged at runtime — vitest never type-checked it, which is why the breakage only surfaced in the build job).
   - eslint and Prettier clean on both touched files.


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(web): type the audit operator as nullable to repair the tip build [rocketmq-dashboard]

Posted by "messere1 (via GitHub)" <gi...@apache.org>.
messere1 commented on PR #6730:
URL: https://github.com/apache/rocketmq-dashboard/pull/6730#issuecomment-6196423031

   Closing this: #6735 repaired the same break test-side (the two `operator: null` fixtures in `auditRiskInsights.test.ts` became `undefined`), which keeps `AuditRecord.operator` a non-null `string` as the maintainers intended — the opposite resolution of the same pair, so keeping both would ask for the same fix twice.
   
   For the record, the break this was written against was real: `tsc -b` failed on the then-tip with TS2322 on those two rows, and every PR's Frontend Build went red through no fault of its own until #6735 landed. With the tip repaired this change is redundant — withdrawing it to keep the queue clean.


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(web): type the audit operator as nullable to repair the tip build [rocketmq-dashboard]

Posted by "messere1 (via GitHub)" <gi...@apache.org>.
messere1 closed pull request #6730: fix(web): type the audit operator as nullable to repair the tip build
URL: https://github.com/apache/rocketmq-dashboard/pull/6730


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(web): type the audit operator as nullable to repair the tip build [rocketmq-dashboard]

Posted by "messere1 (via GitHub)" <gi...@apache.org>.
messere1 commented on PR #6730:
URL: https://github.com/apache/rocketmq-dashboard/pull/6730#issuecomment-6261672417

   Closing this: #6735 repaired the same break test-side (the two `operator: null` fixtures in `auditRiskInsights.test.ts` became `undefined`), which keeps `AuditRecord.operator` a non-null `string` as the maintainers intended — the opposite resolution of the same pair, so keeping both would ask for the same fix twice.
   
   For the record, the break this was written against was real: `tsc -b` failed on the then-tip with TS2322 on those two rows, and every PR's Frontend Build went red through no fault of its own until #6735 landed. With the tip repaired this change is redundant — withdrawing it to keep the queue clean.
   


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org