Compare commits

...
Author SHA1 Message Date
Sonarly Claude Code 224e3b2b1f fix: add WorkspaceMigrationGraphqlApiExceptionInterceptor to MarketplaceResolver
https://sonarly.com/issue/20769?type=bug

When a marketplace app install fails manifest validation, the user gets a raw unformatted exception instead of structured validation errors because the MarketplaceResolver is missing the error-formatting interceptor.

Fix: Added the `WorkspaceMigrationGraphqlApiExceptionInterceptor` to the `MarketplaceResolver`, matching the pattern used by `ApplicationManifestResolver` and `ApplicationDevelopmentResolver`:

1. **marketplace.resolver.ts**: Added `@UseInterceptors(WorkspaceMigrationGraphqlApiExceptionInterceptor)` decorator and its import. This ensures that when `installMarketplaceApp` triggers a `WorkspaceMigrationBuilderException` during manifest validation, the interceptor catches it and converts it into a structured `BaseGraphQLError` with per-entity validation details (error code `METADATA_VALIDATION_ERROR`), instead of letting the raw exception propagate to Sentry as an unhandled error.

2. **marketplace.module.ts**: Added `WorkspaceMigrationGraphqlApiExceptionInterceptor` as a provider so NestJS can inject its dependencies (specifically `I18nService`).
2026-04-01 20:20:43 +00:00
2 changed files with 5 additions and 1 deletions
@@ -11,6 +11,7 @@ import { MarketplaceService } from 'src/engine/core-modules/application/applicat
import { FeatureFlagModule } from 'src/engine/core-modules/feature-flag/feature-flag.module';
import { TwentyConfigModule } from 'src/engine/core-modules/twenty-config/twenty-config.module';
import { PermissionsModule } from 'src/engine/metadata-modules/permissions/permissions.module';
import { WorkspaceMigrationGraphqlApiExceptionInterceptor } from 'src/engine/workspace-manager/workspace-migration/interceptors/workspace-migration-graphql-api-exception.interceptor';
import { MarketplaceCatalogSyncCommand } from 'src/engine/core-modules/application/application-marketplace/crons/commands/marketplace-catalog-sync.command';
@Module({
@@ -29,6 +30,7 @@ import { MarketplaceCatalogSyncCommand } from 'src/engine/core-modules/applicati
MarketplaceCatalogSyncCronCommand,
MarketplaceCatalogSyncCommand,
MarketplaceResolver,
WorkspaceMigrationGraphqlApiExceptionInterceptor,
],
exports: [
MarketplaceCatalogSyncService,
@@ -1,4 +1,4 @@
import { UseFilters, UseGuards } from '@nestjs/common';
import { UseFilters, UseGuards, UseInterceptors } from '@nestjs/common';
import { Args, Mutation, Query } from '@nestjs/graphql';
import { PermissionFlagType } from 'twenty-shared/constants';
@@ -18,8 +18,10 @@ import { MarketplaceCatalogSyncCronJob } from 'src/engine/core-modules/applicati
import { InjectMessageQueue } from 'src/engine/core-modules/message-queue/decorators/message-queue.decorator';
import { MessageQueue } from 'src/engine/core-modules/message-queue/message-queue.constants';
import { MessageQueueService } from 'src/engine/core-modules/message-queue/services/message-queue.service';
import { WorkspaceMigrationGraphqlApiExceptionInterceptor } from 'src/engine/workspace-manager/workspace-migration/interceptors/workspace-migration-graphql-api-exception.interceptor';
@MetadataResolver()
@UseInterceptors(WorkspaceMigrationGraphqlApiExceptionInterceptor)
@UseFilters(ApplicationRegistrationExceptionFilter)
@UseGuards(UserAuthGuard, WorkspaceAuthGuard, NoPermissionGuard)
export class MarketplaceResolver {