Closed flupke closed 1 year ago
You're better off using your application's own Repo
module for queries, even for Oban.Job
. The Oban.Repo
module is for internal modules like engines and plugins, and it's primarily a wrapper for dynamic repos.
That said, I'll look into fixing up the typespec(s).
@flupke I've just opened #798 to warn about this use case and sidestep the typespec issue.
Environment
Oban Version: 2.13.2 PostgreSQL Version: 14.4 Elixir & Erlang/OTP Versions: 1.14.0 / OTP 25
Current Behavior
The following query:
Creates a dialyzer error:
Because
Oban.Repo.one()
typespec is too restrictive:I think it should include
term()
in the return types union, to match the Ecto return type: https://hexdocs.pm/ecto/Ecto.Repo.html#c:one/2Expected Behavior
This query should not produce a dialyzer error.