server
server copied to clipboard
Remove extra JSON.stringify in event bus publisher
trafficstars
The event bus publisher has an extra JSON.stringify statement that causes consumers to perform double JSON.parse. This affects multiple components including the VC Engine library and other engines.
References
- PR discussion: https://github.com/alkem-io/virtual-contributor-ingest-space/pull/64#discussion_r1925172934
- Code location: https://github.com/alkem-io/server/blob/ea039ae45ea61f6941eda564bd124cff452f83f7/src/services/infrastructure/event-bus/publisher.ts#L22
Impact
- Requires double JSON.parse in consumers
- Affects VC Engine library and other engines
- Makes the code harder to understand and maintain
Required Changes
- Remove the extra JSON.stringify in the event bus publisher
- Update VC Engine library to handle the change
- Update other engines to handle the change