fix: use injected bookingEventHandler for proper DI#25273
Merged
hariombalhara merged 1 commit intobooking-audit-difrom Nov 19, 2025
Merged
fix: use injected bookingEventHandler for proper DI#25273hariombalhara merged 1 commit intobooking-audit-difrom
hariombalhara merged 1 commit intobooking-audit-difrom
Conversation
Use the injected bookingEventHandler from dependencies instead of creating a new instance locally. This enables proper dependency injection and allows tests to stub/observe the handler, which should fix CI test failures related to email notifications in reschedule and round-robin reassignment tests. Co-Authored-By: hariom@cal.com <hariombalhara@gmail.com>
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
hariombalhara
added a commit
that referenced
this pull request
Nov 19, 2025
Use the injected bookingEventHandler from dependencies instead of creating a new instance locally. This enables proper dependency injection and allows tests to stub/observe the handler, which should fix CI test failures related to email notifications in reschedule and round-robin reassignment tests. Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
This PR fixes CI test failures in the booking-audit-di branch by using the injected
bookingEventHandlerdependency instead of creating a new instance locally inRegularBookingService.Context: This is a follow-up fix for PR #25123 which added DI infrastructure for the BookingAudit system. CI was failing with "Unhandled Errors" about emails not being sent in
reschedule.test.tsandroundRobinManualReassignment.test.ts, even though tests passed locally.Root cause: The code was creating a new
BookingEventHandlerServiceinstance instead of using the injected dependency fromdeps.bookingEventHandler. This prevented tests from properly stubbing/observing the handler, causing CI failures.The fix: Changed line 2261 in
RegularBookingService.tsto usedeps.bookingEventHandlerdirectly, aligning with the DI pattern introduced in the parent PR.Visual Demo
N/A - This is an internal refactoring to fix test failures. No user-facing changes.
Mandatory Tasks
How should this be tested?
Prerequisites:
booking-audit-dibranch, notmainTesting steps:
TZ=UTC yarn testto verify all unit tests passExpected behavior:
Checklist
Important Notes for Reviewers
DI wiring completeness: Please verify that all call sites instantiating
RegularBookingServiceprovide thebookingEventHandlerdependency. Check:packages/features/bookings/di/RegularBookingService.module.tsRegularBookingServiceis constructedCI validation: This fix is based on analysis of CI failures that didn't reproduce locally. The actual validation will happen when CI runs on this PR.
Base branch: This PR targets
booking-audit-di, notmain. It should be merged to booking-audit-di first, then that branch can be merged to main.Devin session: https://app.devin.ai/sessions/343c8e5dcda94d85b77a3eb65a30a7c6
Requested by: @hariombalhara (hariom@cal.com)