Closed eXpl0it3r closed 1 year ago
The issue was that the JobbrServer was added to the DI container to more easily resolve its dependencies, this then however lead to the BackChannelWebHost creating a new instance for every sub-component and consequently the duplication of the message dispatching subscriptions.
While the manual instantiation now works, it begs the question, whether there's something fundamentally broken with the new DI / WebHost setup. Not necessarily because of SimpleInjector, but because of the mixing between Microsoft Service DI and SimpleInjector registrations. For now, I can't detect any other issues, but might keep a closer eye on this.
Fixed with 396a8566acc129ef27a559ceb686736bc3921a29
Steps to Reproduce
Actual Behavior
The JobbrServer constructor is called four times. Which also means if you trigger a job in the UI, four job runs are added.
Expected Behavior
The JobbrServer is only instantiated once and creating triggers doesn't cause a quadruplication of job runs.
Additional Information
WireUp()
function inMessageDispatcher
is called for each JobbrServer instance, subscribing the trigger action four times