Free, Open Source, Self-Hosted WhatsApp API Gateway
TypeScript apibotgatewayself-hostedwhatsappwhatsapp-apiwhatsapp-automationwhatsapp-botwhatsapp-gatewaywhatsapp-gateway-apiwhatsapp-webwhatsapp-web-api
fix: remove unimplemented message queue processor stub
rmyndharisfb73ccce9c2b
diff --git a/src/modules/queue/processors/message.processor.ts b/src/modules/queue/processors/message.processor.tsdeleted file mode 100644index 257d9e2e1..000000000--- a/src/modules/queue/processors/message.processor.ts+++ /dev/null@@ -1,54 +0,0 @@-import { Processor, WorkerHost } from '@nestjs/bullmq';-import { Job } from 'bullmq';-import { createLogger } from '../../../common/services/logger.service';-import { QUEUE_NAMES } from '../queue-names';--export interface MessageJobData {- sessionId: string;- to: string;- content: string;- type: 'text' | 'media';- mediaUrl?: string;- mediaType?: string;-}--export interface MessageJobResult {- messageId: string;- timestamp: Date;- status: 'sent' | 'failed';- error?: string;-}--/**- * @deprecated This processor is a placeholder and NOT IMPLEMENTED.- * Message queue is not yet functional. Using this will result in an error.- *- * TODO: Implement actual message delivery via SessionService/MessageService- * - Inject SessionService to get active session- * - Use MessageService.send() for actual delivery- * - Handle session not found, not ready, etc.- */-@Processor(QUEUE_NAMES.MESSAGE)-export class MessageProcessor extends WorkerHost {- private readonly logger = createLogger('MessageProcessor');-- async process(job: Job<MessageJobData>): Promise<never> {- this.logger.log(`Processing message job ${job.id}`, {- sessionId: job.data.sessionId,- to: job.data.to,- action: 'message_process_start',- });-- // FAIL FAST: Throw error so BullMQ marks job as failed- const errorMessage =- 'MessageProcessor is not implemented. Message queue is disabled. ' + 'Use direct MessageService.send() instead.';-- this.logger.error(`Message job ${job.id} failed: ${errorMessage}`, undefined, {- sessionId: job.data.sessionId,- action: 'message_process_not_implemented',- });-- // Throw error to make BullMQ mark job as failed (not completed)- return Promise.reject(new Error(errorMessage));- }-}diff --git a/src/modules/queue/queue.module.ts b/src/modules/queue/queue.module.tsindex 292b43c37..3990cce58 100644--- a/src/modules/queue/queue.module.ts+++ b/src/modules/queue/queue.module.ts@@ -5,7 +5,6 @@ import { BullBoardModule } from '@bull-board/nestjs';import { BullMQAdapter } from '@bull-board/api/bullMQAdapter';import { ExpressAdapter } from '@bull-board/express';import { TypeOrmModule } from '@nestjs/typeorm';-import { MessageProcessor } from './processors/message.processor';import { WebhookProcessor } from './processors/webhook.processor';import { QUEUE_NAMES } from './queue-names';import { Webhook } from '../webhook/entities/webhook.entity';@@ -31,21 +30,17 @@ export { QUEUE_NAMES } from './queue-names';},}),}),- BullModule.registerQueue({ name: QUEUE_NAMES.MESSAGE }, { name: QUEUE_NAMES.WEBHOOK }),+ BullModule.registerQueue({ name: QUEUE_NAMES.WEBHOOK }),BullBoardModule.forRoot({route: '/admin/queues',adapter: ExpressAdapter,}),- BullBoardModule.forFeature({- name: QUEUE_NAMES.MESSAGE,- adapter: BullMQAdapter,- }),BullBoardModule.forFeature({name: QUEUE_NAMES.WEBHOOK,adapter: BullMQAdapter,}),],- providers: [MessageProcessor, WebhookProcessor],+ providers: [WebhookProcessor],exports: [BullModule],})export class QueueModule {}