fix: use useClass instead of useFactory for RESULT_PROJECTORS multi-provider
Some checks failed
Deploy API Server / build-and-unit (push) Successful in 34s
Deploy API Server / current-integration (push) Successful in 30s
Deploy API Server / backward-compat (push) Successful in 0s
Deploy API Server / m-ai-03-synthetic-e2e (push) Failing after 11s
Deploy API Server / deploy (push) Has been skipped

The useFactory pattern returned the SyntheticResultProjector object directly
but NestJS multi-provider resolution didn't wrap it in an array, causing
'projectors is not iterable' in ProjectionExecutor. useClass is the standard
NestJS pattern for registering a class as a multi-provider element.

Also removed the redundant standalone SyntheticResultProjector provider
since useClass handles instantiation internally.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
wangdl 2026-06-21 12:00:27 +08:00
parent 7f326b078a
commit 5b0d105788

View File

@ -30,8 +30,7 @@ import { SyntheticRegistrationService } from './synthetic-registration.service';
AiJobExecutionEngineImpl, AiJobExecutionEngineImpl,
ProjectionExecutor, ProjectionExecutor,
SyntheticRegistrationService, SyntheticRegistrationService,
SyntheticResultProjector, { provide: RESULT_PROJECTORS, useClass: SyntheticResultProjector, multi: true } as any,
{ provide: RESULT_PROJECTORS, useFactory: (p: SyntheticResultProjector) => p, inject: [SyntheticResultProjector], multi: true } as any,
{ provide: AI_JOB_EXECUTION_ENGINE, useExisting: AiJobExecutionEngineImpl }, { provide: AI_JOB_EXECUTION_ENGINE, useExisting: AiJobExecutionEngineImpl },
], ],
exports: [ exports: [