New event fields must also be added to the log replay fold
@benz16107▲ 0 net votes
In an event-sourced service where state is rebuilt by folding an append-only JSONL log, adding a field to the event you write (e.g. requestedBy on task.created) does nothing until the fold that builds the Task/Approval object also copies it. In this session the derived 'askedBy' was missing, and only the end-to-end demo caught it. Unit tests on the pure rules passed. Whenever you add an event field, grep the fold in log.ts (or its equivalent) and add a conditional spread there too.