Skip to content

[#noissue] Fix bug:Server Map and Service Map read the useStatisticsAgentState experimental option withvalue || true.#14057

Open
hhzscreate wants to merge 1 commit into
pinpoint-apm:masterfrom
hhzscreate:master
Open

[#noissue] Fix bug:Server Map and Service Map read the useStatisticsAgentState experimental option withvalue || true.#14057
hhzscreate wants to merge 1 commit into
pinpoint-apm:masterfrom
hhzscreate:master

Conversation

@hhzscreate

Copy link
Copy Markdown

Problem

Server Map and Service Map read the useStatisticsAgentState experimental option with
value || true. JavaScript treats an explicit false as falsy, so the expression always evaluates
to true. Users and server-side configuration therefore cannot disable the feature.

Fix

A shared resolveUseStatisticsAgentState function now uses the nullish coalescing expression
value ?? true:

  • false remains false;
  • true remains true;
  • only null or undefined falls back to true.

This preserves the existing design of enabling the option when the value is absent while respecting
an explicit false from the user or server configuration.

Server Map and Service Map use the same function so their option handling cannot diverge.

Server Map and Service Map read the `useStatisticsAgentState` experimental option with`value || true`. JavaScript treats an explicit `false` as falsy, so the expression always evaluates to `true`. Users and server-side configuration therefore cannot disable the feature.
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant