Open
Description
Describe the bug
Hey folks, I recently upgraded from v0.3.0 to v0.6.0 and the detail page of any error crashed with
** (ArgumentError) cannot load `"[]"` as type {:array, :string} for field :breadcrumbs in %ErrorTracker.Occurrence{__meta__: #Ecto.Schema.Metadata<:loaded, "error_tracker_occurrences">, id: nil, reason: nil, context: nil, breadcrumbs: nil, stacktrace: nil, error_id: nil, error: #Ecto.Association.NotLoaded<association :error is not loaded>, inserted_at: nil}
I already debugged this and it seems that the Ecto adapter Ecto.Adapters.MyXQL
correctly stores arrays (like "[]" for an empty array), but crashes on retrieval.
I think there are two hints that we can not make this work just by configuration:
- I was not able to find documentation on how to make type
:array
work with MyXQL. The closest thing I found was this entry in the docs that describes how to store type:map
in a JSON column. But no word about:array
. - When looking at the MyXQL source we see no implementation for
def loaders(:array, type)...
.
In order to fix this I propose implementing a custom type. I already implemented a proposal that I will show in a PR soon.
To Reproduce
Steps to reproduce the behavior:
- Configure a MySQL/MariaDB db as storage backend.
- Generate some error.
- Try to navigate to the error detail page (like
/errors/1
). - Internal server error.
Expected behavior
Detail page should not crash.