Dialyzer returning an error when used with Phoenix Presence

I have code somewhat similar to the following in a function:

MyApp.Presence.list("somechannel") == []

This causes dialyzer to consider the function to have no_local_return on this function as well as all the functions that call this function. Is there some way to handle that so that it doesn’t propagate all the way up the stack?

I realized that I missed the core dialyzer error:

The call:
MyApp.Presence.list(
  _socket :: %Phoenix.Socket{
    :assigns => _,
    :channel_pid => pid(),
    :topic => binary(),
    _ => _
  }
)

will never return since it differs in arguments with
positions 1 from the success typing arguments:

(%Phoenix.Socket{
  :topic => %Phoenix.Socket{:topic => %Phoenix.Socket{:topic => map(), _ => _}, _ => _},
  _ => _
})

But MyApp.Presence.list/1 seems to work fine when passed a binary/string instead of a socket so I’m not sure what the next step would be. Does this indicate a bug in Phoenix?

I haven’t had time to look into this, but we are tracking this issue on the Phoenix side.
https://github.com/phoenixframework/phoenix/issues/3027

If any dialyzer folks out there want to look into this, it would be much appreciated.

Ah, thanks. I’ll track it there!

@chrismccord my issue was fixed with Fix some typespecs to make dialyzer happy by jeremyowensboggs · Pull Request #116 · phoenixframework/phoenix_pubsub · GitHub which you just released yesterday as part of phoenix_pubsub 1.1.1 phoenix_pubsub | Hex :heart::tada:

Great!