Skip to content

Commit

Permalink
fix: now null sdks will also be handled nicely (#8984)
Browse files Browse the repository at this point in the history
We had some error logs, that when SDK is null, then the application
overview query was failing.

This solves it
  • Loading branch information
sjaanus authored Dec 16, 2024
1 parent 39ca516 commit a2f8271
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib/db/client-applications-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
])
Expand Down Expand Up @@ -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
Expand All @@ -412,7 +412,7 @@ export default class ClientApplicationsStore
return acc;
}, []);
environments.forEach((env) => {
env.sdks?.sort();
env.sdks.sort();
});

return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit a2f8271

Please sign in to comment.