1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00

fix: now null sdks will also be handled nicely (#8984)

We had some error logs, that when SDK is null, then the application
overview query was failing.

This solves it
This commit is contained in:
Jaanus Sellin 2024-12-16 12:11:48 +02:00 committed by GitHub
parent 39ca516823
commit a2f82716d1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 3 deletions

View File

@ -325,7 +325,7 @@ export default class ClientApplicationsStore
'COUNT(DISTINCT ci.instance_id) as unique_instance_count',
),
this.db.raw(
'ARRAY_AGG(DISTINCT ci.sdk_version) as sdk_versions',
'ARRAY_AGG(DISTINCT ci.sdk_version) FILTER (WHERE ci.sdk_version IS NOT NULL) as sdk_versions',
),
this.db.raw('MAX(ci.last_seen) as latest_last_seen'),
])
@ -394,7 +394,7 @@ export default class ClientApplicationsStore
env = {
name: environment,
instanceCount: Number(unique_instance_count),
sdks: sdk_versions,
sdks: sdk_versions || [],
lastSeen: latest_last_seen,
issues: {
missingFeatures: featuresNotMappedToProject
@ -412,7 +412,7 @@ export default class ClientApplicationsStore
return acc;
}, []);
environments.forEach((env) => {
env.sdks?.sort();
env.sdks.sort();
});
return {

View File

@ -24,6 +24,7 @@ export const applicationEnvironmentInstancesSchema = {
},
sdkVersion: {
type: 'string',
nullable: true,
description:
'An SDK version identifier. Usually formatted as "unleash-client-<language>:<version>"',
example: 'unleash-client-java:7.0.0',