Problem/Motivation
When a new module is installed (kernel rebuild) the reference between the messenger service and the flashbag is reset. Any messenger service instantiated or any messages set before the this will be lost. See #474684-141: Allow themes to declare dependencies on modules
Also messages set in the early bootstrap are lost as well. Both of these are a regression introduced by #2760167: Add \Drupal\Core\Messenger\Messenger
Proposed resolution
Instead of injecting session.flash_bag
into the messenger inject session
so that when the messenger service adds a message the session is started.
Remaining tasks
User interface changes
None
API changes
In \Drupal\Core\Messenger\Messenger::__construct() change FlashBagInterface to SessionInterface
Data model changes
None