zmuxuny opened a new issue, #5257:
URL: https://github.com/apache/rocketmq-dashboard/issues/5257

   ### Before Creating the Bug Report
   
   - [x] I have searched the [open 
issues](https://github.com/apache/rocketmq-dashboard/issues) of this repository 
and believe that this is not a duplicate.
   
   - [x] This is a defect in RocketMQ Studio, not a usage question and not a 
defect in another Apache RocketMQ repository.
   
   - [x] I can reproduce this on the current `master` branch, or I have stated 
the exact version I am running below.
   
   
   ### Studio Version
   
   branch: rocketmq-studio
   git commit id: a460673fb5b1c61b06f06bac5e48428bb479fa07
   Reproduced from source on an unchanged checkout.
   
   ### Runtime Environment
   
   Linux; local TypeScript compilation with the repository's locked frontend 
dependencies. No browser or database is needed.
   
   ### Connected RocketMQ Cluster
   
   Not required. This is a frontend compile-time fixture error; no RocketMQ 
cluster or Prometheus endpoint is involved.
   
   ### Build Toolchain
   
   Node.js 24.19.0; TypeScript 5.9.3 from the committed package lock. The same 
error appears in the Node 20 CI build.
   
   ### Describe the Bug
   
   The language-switch regression in 
web/src/components/__tests__/MetricsExplorer.test.tsx creates its deferred 
response with createDeferred<typeof metricData>(). The shared fixture's 
inferred labels type is { cluster: string; node_id: string }, but the 
custom-query response intentionally uses { cluster: 'prod', query: 'custom' }.
   
   The metrics API permits arbitrary string labels through MetricData / 
MetricSeries.labels: Record<string, string>. The deferred fixture is therefore 
narrower than the response contract it models. npm run build starts with tsc 
-b, so this prevents both frontend builds from reaching Vite or the separate 
license gate.
   
   ### Steps to Reproduce
   
   1. Check out the revision above and install the locked frontend dependencies.
   2. Run: cd web && npx tsc -b --force --pretty false
   3. Observe the TS2353 diagnostic at MetricsExplorer.test.tsx:516. This was 
reproduced on an unchanged checkout.
   
   ### What Did You Expect to See?
   
   The custom-query fixture should accept valid MetricData responses with 
different label names. The existing assertions should still verify that a 
pending query survives a language switch and releases the loading state.
   
   ### What Did You See Instead?
   
   src/components/__tests__/MetricsExplorer.test.tsx(516,38): error TS2353: 
Object literal may only specify known properties, and 'query' does not exist in 
type '{ cluster: string; node_id: string; }'.
   
   ### Additional Context
   
   Searched open and recent issues and PRs for MetricsExplorer, TS2353, fixture 
typing, and TypeScript build fixes. Several PRs report this blocker; I did not 
find a dedicated fix.
   
   Proposed scope: type the deferred response with the existing MetricData API 
contract, preserving the custom label and behavioral assertions without casts 
or suppression. Verify the actual project build-mode typecheck and Metrics 
Explorer suite.
   
   Frontend artifact licensing (#5018 / #5019 / #5083) and backend binary 
licensing (#5085) are separate. AI assistance was used to inspect and reproduce 
this issue.
   
   ### Are You Willing to Submit a Pull Request?
   
   - [x] Yes, I am willing to submit a pull request.


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