commanded / eventstore

Event store using PostgreSQL for persistence
MIT License
1.06k stars 146 forks source link

Add test for jsonb serializer and handle lists and unknown atoms #245

Closed danhawkins closed 2 years ago

danhawkins commented 2 years ago

I had a problem when using events that had nested data

  1. The original uses String.to_existing_atom/1 which crashes when we try to convert a string to atom that is not already on the erlang vm
  2. The original deserialiser does not convert maps in lists to atoms, which we need for our events

This change fixes both of those issues, although I solved this locally with my own serialiser, I guessed other people might run into the same issue. Also because of this my tests were passing with in memory adaptor but failing with postgres, this change aligns both when using nested event data