mirror of
https://github.com/Unleash/unleash.git
synced 2025-08-23 13:46:45 +02:00
fix: Correctly merge client application data in metrics aggregation
This commit is contained in:
parent
2278089392
commit
ca6c02cfdb
@ -174,17 +174,16 @@ export default class ClientInstanceService {
|
|||||||
const uniqueRegistrations = Object.values(this.seenClients);
|
const uniqueRegistrations = Object.values(this.seenClients);
|
||||||
const uniqueApps: Partial<IClientApplication>[] = Object.values(
|
const uniqueApps: Partial<IClientApplication>[] = Object.values(
|
||||||
uniqueRegistrations.reduce((soFar, reg) => {
|
uniqueRegistrations.reduce((soFar, reg) => {
|
||||||
let existingProjects = [];
|
const key = `${reg.appName} ${reg.environment}`;
|
||||||
if (soFar[`${reg.appName} ${reg.environment}`]) {
|
const existing = soFar[key] || {};
|
||||||
existingProjects =
|
soFar[key] = {
|
||||||
soFar[`${reg.appName} ${reg.environment}`]
|
...existing,
|
||||||
.projects || [];
|
|
||||||
}
|
|
||||||
soFar[`${reg.appName} ${reg.environment}`] = {
|
|
||||||
...reg,
|
...reg,
|
||||||
projects: [
|
projects: [
|
||||||
...existingProjects,
|
...new Set([
|
||||||
...(reg.projects || []),
|
...(existing.projects || []),
|
||||||
|
...(reg.projects || []),
|
||||||
|
]),
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
return soFar;
|
return soFar;
|
||||||
|
Loading…
Reference in New Issue
Block a user