Skip to content
/ api Public

fix: add Injectable decorator to MatchMapStatusEvent for proper DI#135

Open
Flegma wants to merge 1 commit intomainfrom
fix/match-map-status-event-di
Open

fix: add Injectable decorator to MatchMapStatusEvent for proper DI#135
Flegma wants to merge 1 commit intomainfrom
fix/match-map-status-event-di

Conversation

@Flegma
Copy link
Copy Markdown
Contributor

@Flegma Flegma commented Mar 28, 2026

Summary

  • Add missing @Injectable({ scope: Scope.REQUEST }) decorator to MatchMapStatusEvent
  • Without the decorator on the child class, NestJS falls back to the parent's constructor metadata (4 params), so the 5th parameter (NotificationsService) is never injected
  • This caused this.notifications to be undefined at runtime, crashing with TypeError: Cannot read properties of undefined (reading 'sendMatchMapPauseNotification') when a match map enters the "Paused" status, preventing matches from starting/progressing

Test plan

  • Verify matches can start and progress through map statuses without errors
  • Verify pausing a match map triggers the pause notification without crashing
  • Verify no regression in other match event processors

Without @Injectable() on the child class, NestJS cannot generate
design:paramtypes metadata for the child's constructor. It falls back
to the parent's metadata (4 params), so the 5th param
(NotificationsService) is never injected, causing a TypeError when
sendMatchMapPauseNotification is called during match map pause events.
@Flegma Flegma requested a review from lukepolo March 28, 2026 09:05
@lukepolo
Copy link
Copy Markdown
Contributor

so this will also cause moe memory usage, we might want to just add notification service on to the parent class. the request scope means each time it comes into will generate the notification service (new) each time.

@lukepolo
Copy link
Copy Markdown
Contributor

TLDR; just add the notification service to the parent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants