• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Unleash / unleash / 27192288066
87%
master: 91%

Build:
Build:
LAST BUILD BRANCH: main
DEFAULT BRANCH: master
Ran 09 Jun 2026 08:06AM UTC
Jobs 1
Files 1186
Run time 2min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

09 Jun 2026 07:59AM UTC coverage: 87.344% (+0.03%) from 87.317%
27192288066

push

github

web-flow
fix: remove SDK registration and metrics `environment` field (#12224)

## About the changes

We still hold environment field on SDK registration and metrics payloads
despite being deprecated in v5.

Here, we enforce the `environment` to be inferred from the API token
rather than client-provided payload metadata.

Before:

```
resolveMetricsEnvironment(user, data) {
    if (user instanceof ApiUser) {
        if (user.environment !== ALL) {
            return user.environment;
        } else if (user.environment === ALL && data.environment) {
            return data.environment;    // <-- the change - this is GONE!
        }
    }
    return 'default';
}
```

Meaning that, when a wildcard-scoped token POSTs metrics with
`environment` in the body, the server uses the body's value. But, now,
the `environment` is not part of the schema, so, we remove the body
field and metric attribution, thus, path changes to 'default' for those
callers.

**Who's not affected**: everyone using narrow-scoped tokens (the already
documented + recommended path, most customers do already).

**Who's affected**: users with instance-wide API tokens
(environment='*'). The token-issuer doesn't fail, the metric just gets
attributed to the wrong bucket. We already track these users and they
are notified for the deprecation change. Thus, we assume no risk at the
moment.

#### SDK situation 

The `unleash-node-sdk` already doesn't send `environment` in its
[registration
payload](https://github.com/Unleash/unleash-node-sdk/blob/747d20550/src/metrics.ts#L414-#L426).
✔️  Node SDK users

But, even if any other SDK sends the `environment` field, the server
silently drops it via Joi `stripUnknown: true`.
✔️ No SDK breakage 



### In a nutshell, here, we:
- update OSS schemas (no environment params)
- remove the wildcard fallback on server logic part
- preserve-from-seenClients semantics (as broken test unveiled)
- adapt tests on new logic


Closes #EG-4386

##... (continued)

1865 of 2056 branches covered (90.71%)

8 of 8 new or added lines in 3 files covered. (100.0%)

1 existing line in 1 file now uncovered.

15176 of 17375 relevant lines covered (87.34%)

810.98 hits per line

Coverage Regressions

Lines Coverage ∆ File
1
89.58
-2.08% src/lib/features/frontend-api/client-feature-toggle-read-model.ts
Jobs
ID Job ID Ran Files Coverage
1 27192288066.1 09 Jun 2026 08:06AM UTC 1186
87.34
GitHub Action Run
Source Files on build 27192288066
  • Tree
  • List 1186
  • Changed 10
  • Source Changed 8
  • Coverage Changed 8
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #27192288066
  • 15afef7d on github
  • Prev Build on main (#27156704419)
  • Next Build on main (#27193250674)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc