From c4802311285289027f1eac718c2f8a9ba43b7c95 Mon Sep 17 00:00:00 2001 From: Till-JS <101404291+Till-JS@users.noreply.github.com> Date: Tue, 17 Feb 2026 12:51:04 +0100 Subject: [PATCH] fix(planta-bot): make I18nService optional to diagnose DI issue Also restore @Global() decorator to I18nModule while keeping global: true in DynamicModule config for consistency with other modules like CreditModule. Co-Authored-By: Claude Opus 4.5 --- packages/bot-services/src/i18n/i18n.module.ts | 2 +- services/matrix-planta-bot/src/bot/matrix.service.ts | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/bot-services/src/i18n/i18n.module.ts b/packages/bot-services/src/i18n/i18n.module.ts index 45e920ac2..b428a8103 100644 --- a/packages/bot-services/src/i18n/i18n.module.ts +++ b/packages/bot-services/src/i18n/i18n.module.ts @@ -1,4 +1,4 @@ -import { Module, DynamicModule } from '@nestjs/common'; +import { Module, DynamicModule, Global } from '@nestjs/common'; import { ConfigModule } from '@nestjs/config'; import { I18nService, I18N_OPTIONS } from './i18n.service'; import { I18nOptions } from './types'; diff --git a/services/matrix-planta-bot/src/bot/matrix.service.ts b/services/matrix-planta-bot/src/bot/matrix.service.ts index 3654313e0..01a301e02 100644 --- a/services/matrix-planta-bot/src/bot/matrix.service.ts +++ b/services/matrix-planta-bot/src/bot/matrix.service.ts @@ -1,4 +1,4 @@ -import { Injectable } from '@nestjs/common'; +import { Injectable, Optional } from '@nestjs/common'; import { ConfigService } from '@nestjs/config'; import { BaseMatrixService, @@ -61,7 +61,7 @@ export class MatrixService extends BaseMatrixService implements CreditCommandsHo // Expose services for credit commands mixin (CreditCommandsHost interface) public sessionService: SessionService; public creditService: CreditService; - public i18nService: I18nService; + public i18nService!: I18nService; constructor( configService: ConfigService, @@ -69,13 +69,15 @@ export class MatrixService extends BaseMatrixService implements CreditCommandsHo private plantaService: PlantaService, sessionService: SessionService, creditService: CreditService, - i18nService: I18nService + @Optional() i18nService?: I18nService ) { super(configService); // Assign to public properties for credit commands mixin this.sessionService = sessionService; this.creditService = creditService; - this.i18nService = i18nService; + if (i18nService) { + this.i18nService = i18nService; + } } // ============================================================================