Closed mruoss closed 1 year ago
I tried to reproduce this in a fresh project (mix new mwstest
) with this module:
defmodule Mwstest do
def new_and_upgrade do
{:ok, conn} = Mint.HTTP.connect(:https, "localhost", 9_000)
upgrade(conn, "/socket", [])
end
def upgrade(conn, path, headers) do
{:ok, conn, ref} = Mint.WebSocket.upgrade(:wss, conn, path, headers)
{:ok, conn, [{:status, ^ref, status}, {:headers, ^ref, resp_headers} | _]} =
receive(do: (msg -> Mint.WebSocket.stream(conn, msg)))
Mint.WebSocket.new(conn, ref, status, resp_headers)
end
end
but the dialyzer passes successfully.
Can you provide a minimal project that triggers the error? Also - what versions of Mint, Mint.WebSocket, Elixir and OTP are you running?
Oh your're right... very strange. I can't reproduce it on a fresh project either!
Mint: 1.4.2 Mint.WebSocket: 1.0.1 Elixir: 1.14.1 OTP: 25.0.4
I'll spend some more time figuring this out.
Deleted the plts, error is gone. I got other errors but they might be fixed with #27
Indeed, if I use the main branch, no more dialyzer problems.
I'll cut a patch release so the dialyzer fixes are published 👍
That's perfect, thank you. I really like this module, thank you for your efforts! I'm currently using it here: https://github.com/coryodaniel/k8s/pull/199
Hi there
In my codebase I'mm defining the following function to upgrade a connection:
Running dialyzer, I get the following feedback:
I tried to figure out why this happens and I think it's got to do with the
Mint.WebSocket.upgrade/5
function. Although its spec looks fine, if I ommit that function call, dialyer seems happy. Any ideas?