whatwasit
whatwasit copied to clipboard
Whatwasit version issues with elixir 1.13.4 and OTP-23
Hi @smpallen99, @gmile, @mebezac , @lpil
In my project Whatwasit was configured and was working fine. But recently we have upgraded the elixir version to 1.13.4 and OTP-23 and while running the Exunit tests most of the tests are failing because of prepare_version(opts).
As we have not done any code change related to this and application is working as expected, but facing issues for the Exunit tests. Below is the error we are getting.
** (FunctionClauseError) no function clause matching in Ecto.Changeset.cast/4
when attempting to create or update an object.
The following arguments were given to Ecto.Changeset.cast/4:
# 1
MyTest.Whatwasit.Version
# 2
%{action: "update", item_id: 730, item_type: "AdminUser", item_user_id: nil, object: %{admin_author_id: nil, availability_flag: false, email: "[email protected]", failed_log_in_attempts: 0, full_name: "Petra fhghgf", groups: nil, id: 730, inserted_at: ~N[2023-06-09 10:46:47.691601], last_locked_at: nil, last_log_in_at: nil, last_log_in_remote_ip: nil, last_password_reset_at: nil, last_seen_at: nil, log_in_count: 0, reset_password_sent_at: nil, reset_password_token: nil, roles: ["admin"], updated_at: ~N[2023-06-09 10:46:47.692937], uuid: "df6789e9-f5a0-9876-80c4-0bgb72d777d2"}, whodoneit_admin_id: 729, whodoneit_admin_name: "test acc", whodoneit_id: nil, whodoneit_name: nil}
# 3
[:item_type, :item_id, :item_user_id, :object, :action, :whodoneit_id, :whodoneit_name, :whodoneit_admin_id, :whodoneit_admin_name]
# 4
[]
Attempted function clauses (showing 5 out of 5):
def cast(_data, %{__struct__: _} = params, _permitted, _opts)
def cast({data, types}, params, permitted, opts) when is_map(data)
def cast(%Ecto.Changeset{types: nil}, _params, _permitted, _opts)
def cast(%Ecto.Changeset{changes: changes, data: data, types: types, empty_values: empty_values} =
changeset, params, permitted, opts)
def cast(%{__struct__: module} = data, params, permitted, opts)
code: patch(
stacktrace:
(ecto 3.3.4) Ecto.Changeset.cast/4
(my_test 4.0.0) lib/my_test/shared/whatwasit_version.ex:42: MyTest.Whatwasit.Version.module_changeset/2
(my_test 4.0.0) lib/my_test/shared/whatwasit_version.ex:117: MyTest.Whatwasit.Version.insert_version/3
If I comment prepare_version(opts) in the Changeset, tests are passing.
Kindly help fixing this issue.
Thank you.
Hi @rakeshtripathy1. Please do not tag people in your issues. If people are maintaining a repository then they will have enabled notifications for the repository.
I'm not familiar with this project, but upgrading the Elixir and OTP versions won't have caused the issue. I would look to see if any other dependency versions were changed, such as Ecto.
The README of this project suggests it is not considered stable yet, it has not been updated in some years, and it has few downloads on Hex, so you may have a better experience with another library, or using a database trigger to write changes to another table.