File tree Expand file tree Collapse file tree 1 file changed +5
-12
lines changed Expand file tree Collapse file tree 1 file changed +5
-12
lines changed Original file line number Diff line number Diff line change @@ -312,17 +312,10 @@ export class ConnectClusterTool extends AtlasToolBase {
312312 ) : ConnectionMetadata {
313313 const parentMetadata = super . resolveTelemetryMetadata ( result , ...args ) ;
314314 const connectionMetadata = this . getConnectionInfoMetadata ( ) ;
315- // Explicitly merge, preferring parentMetadata for known overlapping keys (project_id, org_id)
316- // since parent has more complete information from tool arguments
317- const { project_id, org_id, ...restConnectionMetadata } = connectionMetadata ;
318- const finalProjectId = parentMetadata . project_id ?? project_id ;
319- const finalOrgId = parentMetadata . org_id ?? org_id ;
320- return {
321- ...parentMetadata ,
322- ...restConnectionMetadata ,
323- // Only include project_id and org_id if they are defined
324- ...( finalProjectId !== undefined && { project_id : finalProjectId } ) ,
325- ...( finalOrgId !== undefined && { org_id : finalOrgId } ) ,
326- } ;
315+ if ( connectionMetadata . project_id !== undefined ) {
316+ // delete the project_id from the parent metadata to avoid duplication
317+ delete parentMetadata . project_id ;
318+ }
319+ return { ...parentMetadata , ...connectionMetadata } ;
327320 }
328321}
You can’t perform that action at this time.
0 commit comments