sequent icon indicating copy to clipboard operation
sequent copied to clipboard

Sequent::Core::Persistors::ActiveRecordPersistor fails when record has `belongs_to` while replaying

Open lvonk opened this issue 3 years ago • 0 comments

Out of the box Sequent uses the Sequent::Core::Persistors::ActiveRecordPersistor for replaying events on a Sequent migration. When a record has a belongs_to it expects the "parent" record to exist. During replay this is not guaranteed since the default replay strategy replays on aggregate_id. Although we don't expect any validations on projections (records) they should probably be skipped explicitly nonetheless, my guess is that would skip the belongs_to check as well. As work around, and recommendation, you should configure Sequent to use the Sequent::Core::Persistors::ReplayOptimizedPostgresPersistor during replay.

lvonk avatar Jan 19 '23 12:01 lvonk