#23433 was a bit hacky in creating the event listener for the session metadata manager. This moves it to a more correct architecture solution. Why does this matter? It allows the event to be properly tested without having to load a boatload of unrelated code is part of it. To accomplish this, the following changes are made:
Create a new LazyServiceEventListener, this is a decorator for a service from the DI container which needs to be lazy loaded at runtime (whereas event subscribers/listeners generally have to be instantiated when registered to the dispatcher, see old PR for why this is relevant)
Moves the event listener out from being a Closure in the Session service provider to its own class
Testing Instructions
Session metadata is still correctly processed, check database for this
@SharkyKZ this was a 'bug' i reported some months ago, but in the current Alpha 7 this seems to be fixed. On first visit the client is now '0' and not NULL
alikon
- test_item
- 6 Mar 2019
- Tested successfully
IIRC part of the intent with #23433 was to fix that bug in the first place. Although looking again it looks like the wrong pseudo-constants are being checked here and this needs correcting.
Nevermind, janky code it is.