zio-entity icon indicating copy to clipboard operation
zio-entity copied to clipboard

Ignored decoding errors

Open hamsterready opened this issue 2 years ago • 0 comments

When data is decoded from database and decoding fails, error is ignored (.toOption).

https://github.com/thehonesttech/zio-entity/blob/d1aea32e37bf6613d40b0cadc7e0cf6386628c67/postgres/src/main/scala/zio/entity/postgres/snapshot/PostgresqlKeyValueStore.scala#L39

None is returned: https://github.com/thehonesttech/zio-entity/blob/ba79935546da741dacded8c487ad8b289da5d7d5/core/src/main/scala/zio/entity/core/KeyedAlgebraCombinators.scala#L51-L56

and when state is recovered from snapshot than initial state is being used while in fact error should be raised.

hamsterready avatar May 10 '22 20:05 hamsterready