Eventuous / eventuous

Event Sourcing library for .NET
https://eventuous.dev
Apache License 2.0
447 stars 71 forks source link

Avoid using default type mapper in producer extensions #371

Closed alexeyzimarev closed 5 days ago

alexeyzimarev commented 1 month ago

After moving the type mapper to be an interface, a custom mapper can be used almost everywhere.

The only place where the default static type mapper instance is used is producer extensions. Those extensions are useful as they hide serialisation boilerplate, but there's an issue with having MessageType in ProducedMessage record. The property is used by BaseProducer for diagnostics, but the actual message type used in produce actions is provided by the serialiser. Therefore, there is a chance of using different message types in diagnostics and in the actual produced message, which can lead to issues when finding issues in production.

The solution would be:

linear[bot] commented 4 weeks ago

EVE-55 Avoid using default type mapper in producer extensions

alexeyzimarev commented 5 days ago

Fixed in https://github.com/Eventuous/eventuous/pull/375