elixir-ecto / db_connection

Database connection behaviour
http://hexdocs.pm/db_connection/DBConnection.html
309 stars 112 forks source link

`with` clause in `ownership_checkout/2` always mismatch #173

Closed melpon closed 6 years ago

melpon commented 6 years ago

In db_connection 2.0.0:

  def ownership_checkout(manager, opts) do
    with {:ok, pid} <- Manager.checkout(manager, opts) do
      case Holder.checkout(pid, opts) do

And Manager.checkout/2 spec:

  @spec checkout(GenServer.server, Keyword.t) ::
    :ok | {:already, :owner | :allowed}

As a result, Ecto.Adapters.SQL.Sandbox.checkout/2 returns :ok, but Holder.checkout/2 has not called.

josevalim commented 6 years ago

Good catch, thank you!