Skip to content

fix(core): return false from browser getBooleanFromEnv - #7188

Merged
pichlermarc merged 2 commits into
open-telemetry:mainfrom
embrace-io:overbalance/core-browser-boolean-env
Oct 13, 2026
Merged

pichlermarc merged 2 commits into
open-telemetry:mainfrom
embrace-io:overbalance/core-browser-boolean-env

Conversation

@overbalance

Copy link
Copy Markdown
Contributor

Which problem is this PR solving?

The browser getBooleanFromEnv is typed boolean | undefined and always returns undefined. Published types inline the Node.js barrel, so browser consumers are promised a boolean, and === false checks fail.

Short description of the changes

  • Browser getBooleanFromEnv returns false, matching the Node.js unset path.
  • Browser test for the return value.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • npm run test:browser and npm test in @opentelemetry/core; the new test fails without the fix.

Checklist:

  • Followed the style guidelines of this project
  • Unit tests have been added

@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Pull request dashboard status

Merged · refreshed 2026-10-13 07:50 UTC

Status above doesn't look right?
  • Anything look wrong? Report it with what you expected; it helps us improve the dashboard.

@codecov

codecov Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.08%. Comparing base (9077fd9) to head (ae04895).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7188   +/-   ##
=======================================
  Coverage   95.07%   95.08%           
=======================================
  Files         384      384           
  Lines       13554    13554           
  Branches     3127     3127           
=======================================
+ Hits        12887    12888    +1     
+ Misses        667      666    -1     
Files with missing lines Coverage Δ
...telemetry-core/src/platform/browser/environment.ts 62.50% <100.00%> (+12.50%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@overbalance
overbalance marked this pull request as ready for review October 12, 2026 20:25
@overbalance
overbalance requested a review from a team as a code owner October 12, 2026 20:25
@pichlermarc
pichlermarc added this pull request to the merge queue Oct 13, 2026
Merged via the queue into open-telemetry:main with commit fb33fd4 Oct 13, 2026
25 checks passed
@overbalance
overbalance deleted the overbalance/core-browser-boolean-env branch October 13, 2026 11:01
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.

2 participants