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 uniqueApps: Partial<IClientApplication>[] = Object.values(
|
||||
uniqueRegistrations.reduce((soFar, reg) => {
|
||||
let existingProjects = [];
|
||||
if (soFar[`${reg.appName} ${reg.environment}`]) {
|
||||
existingProjects =
|
||||
soFar[`${reg.appName} ${reg.environment}`]
|
||||
.projects || [];
|
||||
}
|
||||
soFar[`${reg.appName} ${reg.environment}`] = {
|
||||
const key = `${reg.appName} ${reg.environment}`;
|
||||
const existing = soFar[key] || {};
|
||||
soFar[key] = {
|
||||
...existing,
|
||||
...reg,
|
||||
projects: [
|
||||
...existingProjects,
|
||||
...(reg.projects || []),
|
||||
...new Set([
|
||||
...(existing.projects || []),
|
||||
...(reg.projects || []),
|
||||
]),
|
||||
],
|
||||
};
|
||||
return soFar;
|
||||
|
Loading…
Reference in New Issue
Block a user