Ash_paper_trail 0.3.1' extract_casted_params_values/2 is unable to handle Date (a struct)

Today, I run into below error after upgrading ash_paparetrail from 0.3.0 to 0.3.1. However rolling it back to 0.3.0 works well. It seems like it is unable to handle Date struct.

Full error message:

* ** (Protocol.UndefinedError) protocol Enumerable not implemented for ~D[2025-01-02] of type Date (a struct). This protocol is implemented for the following type(s): DBConnection.PrepareStream, DBConnection.Stream, Date.Range, DetsPlus, Ecto.Adapters.SQL.Stream, File.Stream, Floki.HTMLTree, Function, GenEvent.Stream, HashDict, HashSet, IO.Stream, Iter, Jason.OrderedObject, KrakenDB, List, Map, MapSet, Phoenix.LiveView.LiveStream, Postgrex.Stream, Range, Req.Response.Async, Rewrite, Stream, StreamData, Timex.Interval
  (elixir 1.17.2) lib/enum.ex:1: Enumerable.impl_for!/1
  (elixir 1.17.2) lib/enum.ex:166: Enumerable.reduce/3
  (elixir 1.17.2) lib/enum.ex:4423: Enum.map/2
  (ash_paper_trail 0.3.1) lib/resource/changes/create_new_version.ex:243: AshPaperTrail.Resource.Changes.CreateNewVersion.extract_casted_params_values/2
  (ash_paper_trail 0.3.1) lib/resource/changes/create_new_version.ex:184: anonymous fn/3 in AshPaperTrail.Resource.Changes.CreateNewVersion.build_notifications/3
  (elixir 1.17.2) lib/enum.ex:2531: Enum."-reduce/3-lists^foldl/2-0-"/3
  (ash_paper_trail 0.3.1) lib/resource/changes/create_new_version.ex:157: AshPaperTrail.Resource.Changes.CreateNewVersion.build_notifications/3
  (elixir 1.17.2) lib/enum.ex:1703: Enum."-map/2-lists^map/1-1-"/2
    (elixir 1.17.2) lib/enum.ex:1: Enumerable.impl_for!/1
    (elixir 1.17.2) lib/enum.ex:166: Enumerable.reduce/3
    (elixir 1.17.2) lib/enum.ex:4423: Enum.map/2
    (ash_paper_trail 0.3.1) lib/resource/changes/create_new_version.ex:243: AshPaperTrail.Resource.Changes.CreateNewVersion.extract_casted_params_values/2
    (ash_paper_trail 0.3.1) lib/resource/changes/create_new_version.ex:184: anonymous fn/3 in AshPaperTrail.Resource.Changes.CreateNewVersion.build_notifications/3
    (elixir 1.17.2) lib/enum.ex:2531: Enum."-reduce/3-lists^foldl/2-0-"/3
    (ash_paper_trail 0.3.1) lib/resource/changes/create_new_version.ex:157: AshPaperTrail.Resource.Changes.CreateNewVersion.build_notifications/3
    (elixir 1.17.2) lib/enum.ex:1703: Enum."-map/2-lists^map/1-1-"/2
``

Can you try 0.4.0? just released a fix

1 Like

Thank you @zachdaniel. The is resolved.

1 Like