From c2f5fb88674e9a1aae1c192e7a8b64f39ea1b083 Mon Sep 17 00:00:00 2001 From: Sonarly Claude Code Date: Tue, 12 May 2026 12:16:45 +0000 Subject: [PATCH] fix(ai): stop querying removed MarketplaceApp fields https://sonarly.com/issue/36996?type=bug The AI settings tools table sends a GraphQL query with fields that do not exist on Fix: I fixed the AI settings tools table by removing the invalid `findManyMarketplaceApps` query path that requested non-existent `MarketplaceApp` fields (`icon`, `universalIdentifier`). Concretely: - Removed `FIND_MANY_MARKETPLACE_APPS_FOR_TOOL_TABLE` from `SettingsToolsTable`. - Removed the marketplace-app mapping logic keyed by `universalIdentifier`. - Stopped passing `marketplaceApp` into `SettingsToolIcon`. - Simplified the applications query shape to only request fields actually used (`id`, `name`, `logo`). - Updated `SettingsToolIcon` to render custom/managed tool icons directly from `application.logo` (with the same avatar placeholder fallback), eliminating dependency on removed MarketplaceApp fields. This addresses the root cause in the correct layer (frontend GraphQL operation + rendering path) and prevents the invalid query from being sent on `/settings/ai`. --- .../ai/components/SettingsToolIcon.tsx | 25 +------------ .../ai/components/SettingsToolsTable.tsx | 35 +------------------ 2 files changed, 2 insertions(+), 58 deletions(-) diff --git a/packages/twenty-front/src/pages/settings/ai/components/SettingsToolIcon.tsx b/packages/twenty-front/src/pages/settings/ai/components/SettingsToolIcon.tsx index 37d898b78b9..08ea8b68e9e 100644 --- a/packages/twenty-front/src/pages/settings/ai/components/SettingsToolIcon.tsx +++ b/packages/twenty-front/src/pages/settings/ai/components/SettingsToolIcon.tsx @@ -19,10 +19,6 @@ import { ThemeContext, themeCssVariables } from 'twenty-ui/theme-constants'; type ApplicationInfo = { name: string; -}; - -type MarketplaceAppInfo = { - icon: string; logo?: string | null; }; @@ -31,7 +27,6 @@ type SettingsToolIconProps = { toolName?: string; objectName?: string; application?: ApplicationInfo; - marketplaceApp?: MarketplaceAppInfo; }; const getOperationIcon = (toolName: string): IconComponent | null => { @@ -90,33 +85,15 @@ export const SettingsToolIcon = ({ toolName, objectName, application, - marketplaceApp, }: SettingsToolIconProps) => { const { getIcon } = useIcons(); const { theme } = useContext(ThemeContext); const { objectMetadataItems } = useObjectMetadataItems(); - // Custom tools: application/marketplace icons - if (isDefined(application) && isDefined(marketplaceApp?.logo)) { - return ( - - ); - } - - if (isDefined(marketplaceApp)) { - const MarketplaceIcon = getIcon(marketplaceApp.icon); - return ; - } - if (isDefined(application)) { return ( { findManyApplications: Array<{ id: string; name: string; - universalIdentifier: string; logo?: string | null; }>; }>(FIND_MANY_APPLICATIONS_FOR_TOOL_TABLE); - const { data: marketplaceAppsData } = useQuery<{ - findManyMarketplaceApps: Array<{ - id: string; - universalIdentifier: string; - icon: string; - logo?: string | null; - }>; - }>(FIND_MANY_MARKETPLACE_APPS_FOR_TOOL_TABLE); const { t } = useLingui(); const [searchTerm, setSearchTerm] = useState(''); const [showCustomTools, setShowCustomTools] = useState(true); @@ -166,11 +145,6 @@ export const SettingsToolsTable = () => { application, ]), ); - const marketplaceAppByUniversalIdentifier = new Map( - (marketplaceAppsData?.findManyMarketplaceApps ?? []).map( - (marketplaceApp) => [marketplaceApp.universalIdentifier, marketplaceApp], - ), - ); const filteredTools = allTools .filter((item) => { @@ -275,12 +249,6 @@ export const SettingsToolsTable = () => { const application = isDefined(item.applicationId) ? applicationById.get(item.applicationId) : undefined; - const marketplaceApp = isDefined(application) - ? marketplaceAppByUniversalIdentifier.get( - application.universalIdentifier, - ) - : undefined; - return ( { toolName={item.name} objectName={item.objectName ?? undefined} application={application} - marketplaceApp={marketplaceApp} /> } name={item.name}