Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUGFIX: Relax DefaultEventToListenerMappingProvider checks #263

Conversation

@bwaidelich
Copy link
Member

bwaidelich commented Mar 23, 2020

With #256 the DefaultEventToListenerMappingProvider was introduced
with a very defensive behavior that prevents event store configurations
without matching Listeners.

This was taking it a little far and creates a hen-egg situation for the
initial setup because it requires an EventListenerInterface instance
to exist before a store can be configured.

With this change it's allowed to leave out the listeners configuration:

Neos:
  EventSourcing:
    EventStore:
      stores:
        'event-store':
          storage: 'Neos\EventSourcing\EventStore\Storage\Doctrine\DoctrineEventStorage'

If one is specified it is still validated of course, so the follwing example will lead
to an exception if no EventListener exists yet:

Neos:
  EventSourcing:
    EventStore:
      stores:
        'event-store':
          storage: 'Neos\EventSourcing\EventStore\Storage\Doctrine\DoctrineEventStorage'
          listeners:
            '.*': true
With #256 the `DefaultEventToListenerMappingProvider` was introduced
with a very defensive behavior that prevents event store configurations
without matching Listeners.

This was taking it a little far and creates a hen-egg situation for the
initial setup because it requires an `EventListenerInterface` instance
to exist before a store can be configured.

With this change it's allowed to leave out the `listeners` configuration:

```yaml
Neos:
  EventSourcing:
    EventStore:
      stores:
        'event-store':
          storage: 'Neos\EventSourcing\EventStore\Storage\Doctrine\DoctrineEventStorage'
```

If one is specified it is still validated of course, so the follwing example will lead
to an exception if no EventListener exists yet:

```yaml
Neos:
  EventSourcing:
    EventStore:
      stores:
        'event-store':
          storage: 'Neos\EventSourcing\EventStore\Storage\Doctrine\DoctrineEventStorage'
          listeners:
            '.*': true
```
@bwaidelich

This comment has been minimized.

Copy link
Member Author

bwaidelich commented Mar 23, 2020

FYI: I'll merge this as no-brainer within 24 hours if noone objects

…Provider-checks
@albe
albe approved these changes Mar 24, 2020
@bwaidelich bwaidelich merged commit 24d07bd into neos:master Mar 24, 2020
1 check passed
1 check passed
continuous-integration/styleci/pr The analysis has passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.