1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-09-10 17:53:36 +02:00
Commit Graph

2999 Commits

Author SHA1 Message Date
Gastón Fournier
8cb11f69df
fix: permissions should allow to access client token types (#10543)
Internally token types are still identified as CLIENT, therefore when we
filter the ones we're allowed to see, we should still consider them as
CLIENT tokens not BACKEND tokens. This is internal until we can fully
remove CLIENT with the next major.
2025-08-26 13:33:21 -03:00
Gastón Fournier
750a32f0e9
chore: Etag log and code improvements (#10542)
This is a follow-up on the comments in
https://github.com/Unleash/unleash/pull/10512

Mostly using get and set when accessing the Map
2025-08-26 13:21:37 -03:00
unleash-bot[bot]
0792125bb7
chore(AI): releasePlans flag cleanup (#10537)
This PR cleans up the releasePlans flag. These changes were
automatically generated by AI and should be reviewed carefully.

Fixes #10536

## 🧹 AI Flag Cleanup Summary
The `releasePlans` feature flag has been removed, making the feature
permanently
available for Enterprise customers. All conditional logic and checks
related to
this flag have been removed from the codebase.
This change ensures that Release Plans are an integral part of the
Unleash
Enterprise offering.
### 🚮 Removed
- **Flag Definitions**
- `releasePlans` flag from `experimental.ts` in the backend.
- `releasePlans` flag from `uiConfig.ts` in the frontend.
- `releasePlans` flag from `server-dev.ts` development config.
- **Conditional Logic**
- Removed checks for `releasePlansEnabled` in components and hooks,
including
`ReleaseManagement.tsx`, `FeatureStrategyMenu.tsx`, and
`NewInUnleash.tsx`.
- Removed `useUiFlag('releasePlans')` calls from all frontend files.
- Removed the `flag: 'releasePlans'` property from route definitions in
`routes.ts`.
### 🛠 Kept
- **Feature Functionality**
- All UI and logic related to Release Plans and Release Templates are
now
unconditionally enabled for Enterprise users.
### 📝 Why
The `releasePlans` feature has been successfully rolled out and is now a
stable
part of the product. This cleanup removes the artık feature flag to
simplify the
codebase and reduce complexity.

---------

Co-authored-by: unleash-bot <194219037+unleash-bot[bot]@users.noreply.github.com>
Co-authored-by: Nuno Góis <github@nunogois.com>
2025-08-26 14:48:19 +01:00
Gastón Fournier
ac11af8c05
chore: add some debug statements controlled by a flag (#10532)
## About the changes
Add some **info** logs prefixed with `[etag]` so que can control them
and with this investigate the increase in traffic after the new etag
implementation.
2025-08-25 11:26:36 -03:00
unleash-bot[bot]
8ddeed09fb
chore(AI): projectListViewToggle flag cleanup (#10527)
This PR cleans up the projectListViewToggle flag. These changes were
automatically generated by AI and should be reviewed carefully.

Fixes #10526

## 🧹 AI Flag Cleanup Summary
This change removes the `projectListViewToggle` feature flag and
hardcodes its
behavior. The feature, which allows toggling between card and list views
for
projects, is now permanently enabled.
### 🚮 Removed
- **Flag Definitions**
- Removed `projectListViewToggle` from `src/server-dev.ts`,
`src/lib/types/experimental.ts`, and
`frontend/src/interfaces/uiConfig.ts`.
- **Hooks & Conditionals**
- Removed `useUiFlag('projectListViewToggle')` calls from
`ProjectGroup.tsx`
and `ProjectList.tsx`.
- Removed conditional rendering logic based on the flag in
`ProjectGroup.tsx`
and `ProjectList.tsx`.
### 🛠 Kept
- **Project List View**
- The project list view functionality is now always available for
non-OSS
versions of Unleash.
- The `ProjectsListViewToggle` component is now always rendered when not
in an
OSS environment.
### 📝 Why
The `projectListViewToggle` feature flag was marked as completed and its
intended outcome was to be kept. The code has been updated to reflect
this by
removing the flag and making the feature a permanent part of the
application.
This simplifies the codebase by removing dead code paths and feature
flag
checks.

Co-authored-by: unleash-bot <194219037+unleash-bot[bot]@users.noreply.github.com>
2025-08-25 09:01:59 +01:00
Gastón Fournier
7ea0c9ca9b
feat: support different etags per environment (#10512)
## About the changes
This PR introduces environment-specific etags. This way clients will not
react by updating features when there are changes in environments the
SDK doesn't care about.

## Details
There's a bit of scouting work (please don't make me split this 🙏)
and other details are in comments, but the most relevant for the lazy
ones:
- Important **decision** on how we detect changes, unifying polling and
delta:
https://github.com/Unleash/unleash/pull/10512#discussion_r2285677129
- **Decision** on how we update revision id per environment:
https://github.com/Unleash/unleash/pull/10512#discussion_r2291888401
- and how we do initial fetch on the read path:
https://github.com/Unleash/unleash/pull/10512#discussion_r2291884777
- The singleton pattern that gave me **nightmares**:
https://github.com/Unleash/unleash/pull/10512#discussion_r2291848934
- **Do we still have ALL_ENVS tokens?**
https://github.com/Unleash/unleash/pull/10512#discussion_r2291913249

## Feature flag
To control the rollout introduced `etagByEnv` feature:
[0da567d](0da567dd9b)
2025-08-22 10:35:17 -03:00
Nuno Góis
885d3e1817
chore: implement unknown flags UX feedback (#10519)
https://linear.app/unleash/issue/2-3809/implement-the-latest-feedback-from-ux

Implements the latest feedback from UX regarding **unknown flags**.

Bit unsure about our column headers. E.g. instead of "Last seen" and
"Seen in Unleash" we could call them "Reported" and "Last event".

<img width="1490" height="838" alt="image"
src="https://github.com/user-attachments/assets/30ca2570-1395-429f-8d60-ccc6fe83ba92"
/>
2025-08-22 14:04:01 +01:00
unleash-bot[bot]
18bea25383
chore(AI): paygInstanceStatsEvents flag cleanup (#10510)
This PR cleans up the paygInstanceStatsEvents flag. These changes were
automatically generated by AI and should be reviewed carefully.

Fixes #10507



🧹 AI Flag Cleanup Summary

This change removes the paygInstanceStatsEvents feature flag. The
changes
involve removing its definition from the codebase.

⚠️ No conditional logic for paygInstanceStatsEvents was found in the
provided
files. The logic may exist in another repository, and this change only
removes
the flag's definition.

🚮 Removed

• Configuration
• Removed paygInstanceStatsEvents flag definition from
src/lib/types/experimental.ts.
• Changelog
• Added an entry for the flag cleanup under a new [Unreleased] section
in
CHANGELOG.md.

📝 Why

The paygInstanceStatsEvents feature flag was marked as completed with
the
outcome "kept". This cleanup removes the flag's definition, following
our
standard process for retiring feature flags.

---------

Co-authored-by: unleash-bot <194219037+unleash-bot[bot]@users.noreply.github.com>
Co-authored-by: Thomas Heartman <thomas@getunleash.io>
2025-08-21 13:14:19 +00:00
unleash-bot[bot]
3fffe941c5
chore(AI): paygTrialEvents flag cleanup (#10508)
This PR cleans up the paygTrialEvents flag. These changes were
automatically generated by AI and should be reviewed carefully.

Fixes #10506

## 🧹 AI Flag Cleanup Summary
The `paygTrialEvents` feature flag has been removed from the codebase.
Since no
conditional logic using this flag was found in this repository, only the
flag's
definition and configuration were removed.
⚠️ **Warning:** No conditional logic for this flag was found in the
provided
files. The logic may exist in another repository.
### 🚮 Removed
- **Configuration**
- Removed `paygTrialEvents` from the `IFlagKey` type in
`src/lib/types/experimental.ts`.
- Removed the `paygTrialEvents` flag definition from
`src/lib/types/experimental.ts`.
- Removed `paygTrialEvents` from the development server configuration in
`src/server-dev.ts`.
### 🛠 Kept
- **Feature**
- The `paygTrialEvents` feature is considered enabled by default now.
### 📝 Why
The feature flag `paygTrialEvents` was marked as completed with an
outcome of
"kept". The cleanup involves removing the flag and its related
definitions.

Co-authored-by: unleash-bot <194219037+unleash-bot[bot]@users.noreply.github.com>
Co-authored-by: Thomas Heartman <thomas@getunleash.io>
2025-08-21 15:07:44 +02:00
Gastón Fournier
92480554dc
feat: incorporate backend as a valid api token type replacing client (#10500)
This PR deprecates `CLIENT` api token type in favor of `BACKEND` but
both will continue working.

Also replaces:
- `INIT_CLIENT_API_TOKENS` with `INIT_BACKEND_API_TOKENS`. The former is
kept for backward compatibility.
2025-08-21 09:43:54 -03:00
unleash-bot[bot]
02ee94c38f
chore(AI): createFlagDialogCache flag cleanup (#10509)
This PR cleans up the createFlagDialogCache flag. These changes were
automatically generated by AI and should be reviewed carefully.

Fixes #10504

## 🧹 AI Flag Cleanup Summary
This change removes the `createFlagDialogCache` feature flag, making its
functionality permanent. The create-feature-flag dialog will now always
cache
its state in local storage.
### 🚮 Removed
- **TypeScript Definitions**
- Removed `createFlagDialogCache` from `UiFlags` in
`frontend/src/interfaces/uiConfig.ts`.
- Removed `createFlagDialogCache` from `IFlagKey` in
`src/lib/types/experimental.ts`.
- **Flag Configuration**
- Removed the `createFlagDialogCache` flag definition from
`src/lib/types/experimental.ts`.
- **Conditional Logic**
- Removed the `useUiFlag` hook and conditional logic for caching in

`frontend/src/component/project/Project/PaginatedProjectFeatureToggles/ProjectFe
atureTogglesHeader/CreateFeatureDialog.tsx`.
### 🛠 Kept
- **Feature Functionality**
- The feature of caching the create-flag dialog's form state in local
storage
is now always enabled.
### 📝 Why
The `createFlagDialogCache` feature has been successfully rolled out and
is now
considered stable. This cleanup removes the obsolete feature flag and
hardcodes
the enabled behavior, simplifying the codebase.

Co-authored-by: unleash-bot <194219037+unleash-bot[bot]@users.noreply.github.com>
Co-authored-by: Thomas Heartman <thomas@getunleash.io>
2025-08-21 12:43:43 +00:00
unleash-bot[bot]
170ed87fcb
chore(AI): lifecycleMetrics flag cleanup (#10511)
This PR cleans up the lifecycleMetrics flag. These changes were
automatically generated by AI and should be reviewed carefully.

Fixes #10505

---------

Co-authored-by: unleash-bot <194219037+unleash-bot[bot]@users.noreply.github.com>
Co-authored-by: Thomas Heartman <thomas@getunleash.io>
2025-08-21 14:35:11 +02:00
Nuno Góis
edae8801d8
chore: release template resource limits (#10514)
https://linear.app/unleash/issue/2-3790/use-resource-limits-to-limit-the-amount-of-release-templates-you-can

Adds a new resource limit for release templates.

Needs a follow-up PR in Enterprise.
2025-08-21 11:52:09 +01:00
unleash-bot[bot]
d2452b91f2
chore(AI): crDiffView flag cleanup (#10487)
This PR cleans up the crDiffView flag. These changes were automatically
generated by AI and should be reviewed carefully.

Fixes #10484



🧹 AI Flag Cleanup Summary

This PR removes the crDiffView feature flag and its associated legacy
components
for displaying changes in a Change Request. The flag has been enabled
and the
new diff view is now permanent.

This involved removing the feature flag from the configuration and code,
deleting several legacy components, and updating the components that
used them
to only use the new versions.

🚮 Removed

• Feature Flag Logic
• All checks for the crDiffView flag.
• The flag definition in uiConfig.ts, experimental.ts, and
server-dev.ts.
• Legacy Components
• LegacyStrategyChange.tsx
• StrategyTooltipLink.tsx
• LegacyReleasePlanChange.tsx
• SegmentTooltipLink.tsx
• LegacySegmentChangeDetails.tsx
• LegacyArchiveFeatureChange from ArchiveFeatureChange.tsx
• LegacyDependencyChange from DependencyChange.tsx
• LegacyToggleStatusChange from ToggleStatusChange.tsx

🛠 Kept

• New Components
• The new change request diff view components (StrategyChange,
ReleasePlanChange, etc.) are now used directly.
• The UI for displaying changes in a Change Request now consistently
uses
the improved diff view.

📝 Why

The crDiffView feature flag was deemed complete and ready for permanent
implementation. The cleanup follows standard procedure to remove the
flag and
associated dead code, simplifying the codebase and making it easier to
maintain.
This change makes the improved diff view for change requests the only
available
view.

---------

Co-authored-by: unleash-bot <194219037+unleash-bot[bot]@users.noreply.github.com>
Co-authored-by: Thomas Heartman <thomas@getunleash.io>
2025-08-21 12:33:19 +02:00
unleash-bot[bot]
d6ddc95c1e
chore(AI): improvedJsonDiff flag cleanup (#10486)
This PR cleans up the improvedJsonDiff flag. These changes were
automatically generated by AI and should be reviewed carefully.

Fixes #10483

## 🧹 AI Flag Cleanup Summary
This PR removes the `improvedJsonDiff` feature flag, making the enhanced
JSON
diffing component the default and only option. The now-unused legacy
diff
component and all related feature flag logic have been removed to
streamline the
codebase.
### 🚮 Removed
- **Components**
- `OldEventDiff` component was removed, along with its helper types and
constants.
- **Flag Logic**
- All conditional rendering based on the `improvedJsonDiff` flag was
removed.
- The `sort` prop from `EventDiff` was removed as it was only used by
the
legacy component.
- **Configuration**
- `improvedJsonDiff` flag definition was removed from `uiConfig.ts`,
`experimental.ts`, and `server-dev.ts`.
- **Tests**
- Mock configuration for `improvedJsonDiff` in tests was removed.
### 🛠 Kept
- **Components**
- `NewEventDiff` was renamed to `EventDiff` and is now the standard
implementation.
### 📝 Why
The `improvedJsonDiff` feature flag was marked as completed with its
outcome
being "kept". This cleanup finalizes the feature rollout by removing the
flag
and associated legacy code, simplifying the implementation and reducing
code
complexity.

---------

Co-authored-by: unleash-bot <194219037+unleash-bot[bot]@users.noreply.github.com>
Co-authored-by: Thomas Heartman <thomas@getunleash.io>
2025-08-21 09:50:48 +00:00
Mateusz Kwasniewski
f5eafb2d6e
chore: featchMode flag (#10516) 2025-08-21 10:56:10 +02:00
unleash-bot[bot]
229379ed15
chore(AI): timestampsInChangeRequestTimeline flag cleanup (#10492)
This PR cleans up the timestampsInChangeRequestTimeline flag. These
changes were automatically generated by AI and should be reviewed
carefully.

Fixes #10491

## 🧹 AI Flag Cleanup Summary
This PR removes the `timestampsInChangeRequestTimeline` feature flag.
The
feature is now permanently enabled.
⚠️ No conditional logic for this flag was found in the provided files.
The
changes are limited to removing flag definitions and configurations. The
actual
logic may reside in other parts of the codebase not included in this
operation.
### 🚮 Removed
- **Flag Definitions & Configuration**
- Removed `timestampsInChangeRequestTimeline` from `IFlagKey` type in
`src/lib/types/experimental.ts`.
- Removed `timestampsInChangeRequestTimeline` flag configuration from
`src/lib/types/experimental.ts`.
- Removed `timestampsInChangeRequestTimeline` from the `UiFlags`
interface in
`frontend/src/interfaces/uiConfig.ts`.
- Removed the flag from the experimental flags in `src/server-dev.ts`.
### 🛠 Kept
- **Feature Functionality**
- The behavior previously enabled by the
`timestampsInChangeRequestTimeline`
flag is now the default and only behavior.
### 📝 Why
The `timestampsInChangeRequestTimeline` feature flag was marked as
completed
with an intended outcome of "kept". This means the feature has been
rolled out
successfully and should be permanent. This cleanup removes the obsolete
flag and
its related configurations, simplifying the code and adhering to best
practices
for feature flag lifecycle management.

Co-authored-by: unleash-bot <194219037+unleash-bot[bot]@users.noreply.github.com>
2025-08-21 09:49:37 +02:00
Gastón Fournier
32ddf1487b
chore: ignore CR events with feature name (#10503)
## About the changes
This ignores Change Request event types when calculating the etag
because Change Request events don't change data.

They were being included when the change request event contained a
featureName. After this change, those should be excluded.
2025-08-19 09:46:00 -03:00
Jaanus Sellin
b6ea8a3849
chore: move consumption UI behind separate flag (#10495)
Move consumption UI to separate flag.
2025-08-14 14:25:36 +03:00
Jaanus Sellin
5b879d9331
feat: add origin column for consumption based tables (#10494)
We will start separating traffic, when it comes from different origins.
Also will add it as primary key so merging will work correctly.

There is a problem with using normal down migration, is that if we split
data by origin, when down migrating and removing column, and re adding
the old migration, we will have conflicts and it will fail.

This means before we down migrate, we need to aggregate/sum the data and
only then we can reapply old schema.
2025-08-13 16:16:05 +03:00
Jaanus Sellin
9fe638b0b7
fix: week range for lifecycle backfill (#10493)
It is using almost same logic as
https://github.com/Unleash/unleash/pull/10476, but week range is
correct.
2025-08-13 13:43:52 +03:00
Nuno Góis
105962c5c3
chore: remove flag githubAuth (#10457)
https://linear.app/unleash/issue/2-3736/remove-githubauth-feature-flag

Removes `githubAuth` feature flag.
2025-08-11 10:31:28 -03:00
Tymoteusz Czech
918e792af6
fix: health to technical debt on projects list (#10485) 2025-08-11 11:45:27 +02:00
Jaanus Sellin
04a57e502e
fix: now lifecycle trends will be added for flags that have official flag type (#10482)
We have instances that have fake flag types in features table. This
ensures, we only count in flags have official types.
2025-08-08 13:23:35 +03:00
Gastón Fournier
60a2fa675b
chore: add next.js to findOutdatedSdks (#10479)
Next js also works as a backend SDK (thanks @Tymek for the explanation)
and might be already reporting as
69e8c64927/lib/src/getDefinitions.ts (L79)
2025-08-07 19:31:35 +02:00
Gastón Fournier
057a906892
chore: set min version for new SDK names (#10477)
## About the changes
This sets the minimum version for the new SDK names to the current
latest version. The versions with the new SDK name will be newer, but
this will set the baseline for the future.
2025-08-07 10:30:45 -03:00
Jaanus Sellin
75df390d0b
fix: backfilling lifecycle trends based on new logic (#10476)
Previously lifecycle trends were taking one snapshot per flag, now they
take one per flag per stage it moved.
2025-08-07 15:05:04 +03:00
Tymoteusz Czech
e1b6979627
Feat: filter flags by "last seen at" (#10449)
This lets users filter features by when they were last reported in metrics.
2025-08-04 14:50:21 +02:00
Nuno Góis
bd5a8539c0
chore: add project list view toggle with respective flag (#10452)
https://linear.app/unleash/issue/2-3746/add-project-list-view-toggle-with-respective-flag

Adds a project list view toggle hidden behind a feature flag:
`projectListViewToggle`.

This is already part of the persistent project list page state.

Even though the view mode switching logic is in place, this isn't really
doing anything else. We'll leave the actual visual changes (tables) for
a follow up PR.

<img width="1412" height="406" alt="image"
src="https://github.com/user-attachments/assets/793d0bd9-9874-4630-98b4-0ee364f50241"
/>
2025-08-04 08:53:04 +01:00
Nuno Góis
3338ea4300
chore: clear unknown flags every 24h instead of every 7d (#10446)
https://linear.app/unleash/issue/2-3738/clear-unknown-flags-every-24h-instead-of-every-7d

Clears unknown flags every 24h instead of every 7d.

This ensures the list stays more relevant by removing stale entries
sooner, allowing users to focus on actively reported unknown flags.

Also includes small improvements, including a new paragraph on the
unknown flags page that better explains the concept of unknown flag
reports.
2025-07-31 11:22:40 +01:00
Gastón Fournier
2f1ca50bc4
fix: should be allowed to change strategy (#10441)
## About the changes
Previous PR: https://github.com/Unleash/unleash/pull/10439 introduced a
bug not allowing to update the strategy name

This PR modifies a test to also validate the change of strategy and
fixes the problem
2025-07-30 17:25:17 +02:00
Gastón Fournier
9eb19618bf
fix: stickiness should be preserved on strategy updates (#10439)
## About the changes
When stickiness was set to empty or undefined while updating a strategy
via API the stickiness would be lost.

This adds a validation step after creating a strategy, that updating
with the same data used to create the strategy yields the same result.

The main change was lifting the default logic from the store layer to
the service layer and adapting tests accordingly
2025-07-30 15:47:51 +02:00
Gastón Fournier
629624fd1c
docs: update references and names to new SDK nomenclature (#10431)
## About the changes
Follow up on https://github.com/Unleash/unleash/pull/10430 this PR
adapts documentation.

---------

Co-authored-by: Melinda Fekete <melinda.fekete@getunleash.io>
2025-07-30 14:35:37 +02:00
Gastón Fournier
0f565c50e9
feat: rebrand sdk tokens and sdk types (#10430)
## About the changes
Rebrand SDK tokens and SDK types to make it easier to onboard and use:

**Backend SDK Token**: Intended for server-side SDKs. It can be used to
access:

- The Client Features API (/api/client/features) for fetching all flag
configurations for local evaluation.
- The Frontend API (/api/frontend) for remote evaluation.

**Frontend SDK Token**: Intended for client-side/frontend SDKs. It is
restricted and can only be used to access:

- The Frontend API (/api/frontend) for remote evaluation.

---------

Co-authored-by: Nuno Góis <github@nunogois.com>
2025-07-30 10:24:40 +02:00
unleash-bot[bot]
7830fbb75f
chore(AI): eventGrouping flag cleanup (#10428) 2025-07-29 15:20:10 +03:00
Gastón Fournier
7479720f58
chore: better logging of failed tokens (#10425)
When querying invalid tokens we might catch them for a while to reduce
database load. Being able to identify the token can help understanding
what's going on or the client using that token

Log looks like:
```
[INFO] /services/api-token-service.ts - Token default:development.3ef3... rate limited until: Tue Jul 29 2025 09:53:47 GMT+0000 (Coordinated Universal Time)
```
2025-07-29 12:48:41 +02:00
Nuno Góis
15449e83d3
chore: add feature configuration based on addConfiguration flag (#10420)
https://linear.app/unleash/issue/2-3729/single-add-configuration-button-based-on-flag

Shows a single "Add configuration" button based on whether the new
`addConfiguration` flag is enabled.

This button then shows our "Add configuration" modal which allows you to
choose how to proceed in terms of your feature flag configuration. Also
updates this modal to better match the latest sketches.

Includes scouting.

### Single "Add configuration" button
<img width="738" height="121" alt="image"
src="https://github.com/user-attachments/assets/9cce7fba-5e0c-42e0-a3d1-8ccc34f730bb"
/>

### Modal
<img width="983" height="663" alt="image"
src="https://github.com/user-attachments/assets/b59abad2-f1cd-4b62-bf2e-9c3b24cbb60e"
/>
2025-07-29 08:27:13 +01:00
Melinda Fekete
a6397c51ab
docs: organize feature flags using projects and environments guide (#10402) 2025-07-28 13:33:59 +02:00
Melinda Fekete
b354c4dda3
docs: update OpenAPI Edge name (#10415)
Change the tag of Edge to Unleash Edge in the OpenAPI spec to help with
search relevance in the docs
2025-07-25 12:41:06 +02:00
Nuno Góis
d278185228
feat: GitHub auth (#10406)
https://linear.app/unleash/issue/2-3713/show-sign-in-with-github-auth-option-in-unleash

Adds support for a "Sign-in with GitHub" auth option.

Also took this opportunity to slightly improve the design of these
options on our log in screen.

<img width="485" height="429" alt="image"
src="https://github.com/user-attachments/assets/540cb4d5-f5bc-44a0-a7d7-d895d0f22393"
/>
2025-07-24 15:25:25 +01:00
Thomas Heartman
64050121db
Add timestampsInChangeRequestTimeline flag (#10399)
Adds flag to OSS for the new timestamps in CR timeline capability.

We might not need them in the UI, but might as well add it in case.
2025-07-23 15:33:40 +02:00
Gastón Fournier
57ec5ce876
chore: remove unkonwn flags (#10389)
We're iterating over the keys of experimental and checking if they're
enabled:
e140ab63e1/src/lib/util/flag-resolver.ts (L26)
which leads to this big list of unknown flags

This comes from our report:
<img width="1461" height="1042" alt="image"
src="https://github.com/user-attachments/assets/9579f351-e5e9-42ad-a141-b5cde83a41b8"
/>
2025-07-22 16:49:42 +02:00
Mateusz Kwasniewski
d7f98945a3
chore: Lifecycle graphs flag (#10390) 2025-07-22 14:34:27 +02:00
Gastón Fournier
020e9a49ef
chore: don't fail if array is not ordered properly (#10391)
Spotted it here:
https://github.com/Unleash/unleash/actions/runs/16443263365/job/46468801248
<img width="928" height="584" alt="image"
src="https://github.com/user-attachments/assets/5e430b91-2664-4a79-9f13-cf6da4640046"
/>

where the sort order is different.
2025-07-22 14:30:56 +02:00
Gastón Fournier
e140ab63e1
fix: flaky delete stale session (#10387)
When deleting stale sessions, we sort them by createdAt. If both
sessions are created with the same createdAt, there's a chance we get a
different sort order and we end up with the wrong order:
https://github.com/Unleash/unleash/actions/runs/16438565746/job/46453700977

I think adding 10ms between inserts should be enough (1ms should do,
but this gives me more confidence and doesn't hurt that much)

---------

Co-authored-by: Thomas Heartman <thomas@getunleash.io>
2025-07-22 11:42:14 +00:00
Nuno Góis
51f8244a5d
chore: emit CLIENT_METRICS event after sifting (#10376)
https://linear.app/unleash/issue/2-3705/only-emit-client-metrics-after-sifting-metrics

Only emits the `CLIENT_METRICS` event after metric sifting.

This ensures the event is emitted only for valid metrics tied to known
flags, instead of all flags included in the metrics payload.

See:
https://github.com/Unleash/unleash/pull/10375#discussion_r2218974109
2025-07-21 15:40:02 +01:00
Nuno Góis
8f0c0ccef3
chore: sift metrics on both endpoints (#10375)
https://linear.app/unleash/issue/2-3696/report-unknown-flags-when-sent-to-the-bulk-metrics-endpoint

Unifies metrics sifting logic across both metrics endpoints:
- `/metrics`
- `/metrics/bulk`

This PR improves consistency between the `/metrics` and `/metrics/bulk`
endpoints by introducing a shared `siftMetrics` method, now used within
`registerBulkMetrics`. Both endpoints already call this method at the
end of their respective logic flows, ensuring that metrics are sifted in
the same way regardless of the path taken.

While the primary goal was to enable reporting of unknown flags via the
`/metrics/bulk` endpoint, this change also improves bulk processing by
consistently dropping invalid or unknown flags before insertion, just
like in the regular `/metrics` endpoint.
2025-07-21 12:40:41 +01:00
Mateusz Kwasniewski
f04dd454d9
feat: sanitize impact metrics (#10364) 2025-07-17 12:59:50 +02:00
Mateusz Kwasniewski
1ab8275996
feat: default origin for impact metrics (#10362) 2025-07-16 14:45:44 +02:00
Thomas Heartman
e125c0f072
fix(1-3928): prevent overwriting existing values in instance store (#10360)
Fixes a bug in the instance store where insert and bulkUpsert would
overwrite existing properties if there was a row there already. Now
it'll ignore any properties that are undefined.

The implementation is lifted directly from
`src/lib/db/client-applications-store.ts` (line 107 atm).

Additionally, I've renamed the `insert` method to `upsert` to make it
clearer what it does (and because we already have `bulkUpsert`). The
method seems to only be used in tests, anyway. I do not anticipate any
changes to be required in enterprise (I've checked).

## Discussion points:

This implementation uses `delete` to remove properties from the object.
Why didn't I do it some other way? Two main reasons:
1. We've had this implementation for 4 years in the client applications
store. If there were serious issues with it, we'd probably know by know.
(Probably.)
2. The only way I can think of without deleting, would be to use
`Object.fromEntries` and `Object.toEntries` and either map or reduce.
That'll double the amount of property iterations we'll need to do.

So naively, this strikes me as being more efficient. If you know better
solutions, I will of course be happy to take them. If not, I'd like to
leave this as is and then change it if we see that it's causing issues.
2025-07-16 12:10:15 +00:00