clemensm
Broadcast using LongPoll is failing
Hi there
I’m currently developing a small webapp using Phoenix to send mails to a bunch of contacts. In there I wanted to use a channel to update the send status (i.e. how many mails have already been sent etc). However when I gave this a try using only long polling, I get this error message every time I try to do a broadcast:
[error] GenServer #PID<0.660.0> terminating
** (FunctionClauseError) no function clause matching in Phoenix.Transports.LongPoll.Server.handle_info/2
(phoenix) lib/phoenix/transports/long_poll_server.ex:75: Phoenix.Transports.LongPoll.Server.handle_info(%Phoenix.Socket.Broadcast{event: "progress", payload: %{all: 5, done: 1, pending: 4, progress: 20.0}, topic: "mailing:f52c78c8-4148-4c2a-abaf-c91317ffcf7d"}, %{buffer: [], channels: %{"mailing:f52c78c8-4148-4c2a-abaf-c91317ffcf7d" => #PID<0.666.0>}, channels_inverse: %{#PID<0.666.0> => {"mailing:f52c78c8-4148-4c2a-abaf-c91317ffcf7d", "1"}}, client_ref: {#PID<0.622.0>, #Reference<0.3659197968.2859466756.205729>}, last_client_poll: 1527437359083, priv_topic: "phx:lp:oRFiAZoBxO6vqxRk/SFVjA==1527437358904", pubsub_server: Daten.PubSub, serializer: Phoenix.Transports.V2.LongPollSerializer, socket: %Phoenix.Socket{assigns: %{current_user: %Accounts.User{__meta__: #Ecto.Schema.Metadata<:loaded, "user">, account: %Accounts.Account{__meta__: #Ecto.Schema.Metadata<:loaded, "account">, id: "f52c78c8-4148-4c2a-abaf-c91317ffcf7d", inserted_at: #DateTime<2018-05-25 10:42:28.451558Z>, updated_at: #DateTime<2018-05-25 10:42:28.451570Z>}, email: "c@m", id: "f52c78c8-4148-4c2a-abaf-c91317ffcf7d", inserted_at: #DateTime<2018-05-25 10:42:28.456345Z>, name: "clemens", updated_at: #DateTime<2018-05-25 10:42:28.456352Z>, user_password: %Accounts.UserPassword{__meta__: #Ecto.Schema.Metadata<:loaded, "user_password">, id: 2, inserted_at: #DateTime<2018-05-25 10:42:28.457810Z>, password: nil, password_hash: "$argon2i$v=19$m=65536,t=6,p=1$UG2SFHp/2G7mhq+lGXVmgw$AOjJEKsj14GCfjhOWS/pmXCkWqmTWYcSfnV7WGZCbAQ", updated_at: #DateTime<2018-05-25 10:42:28.457817Z>, user: #Ecto.Association.NotLoaded<association :user is not loaded>, user_id: "f52c78c8-4148-4c2a-abaf-c91317ffcf7d"}}}, channel: nil, channel_pid: nil, endpoint: DatenWeb.Endpoint, handler: DatenWeb.UserSocket, id: "mailing:f52c78c8-4148-4c2a-abaf-c91317ffcf7d", join_ref: nil, joined: false, private: %{}, pubsub_server: Daten.PubSub, ref: nil, serializer: Phoenix.Transports.V2.LongPollSerializer, topic: nil, transport: Phoenix.Transports.LongPoll, transport_name: :longpoll, transport_pid: #PID<0.660.0>, vsn: "2.0.0"}, window_ms: 15000})
(stdlib) gen_server.erl:616: :gen_server.try_dispatch/4
(stdlib) gen_server.erl:686: :gen_server.handle_msg/6
(stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3
Last message: %Phoenix.Socket.Broadcast{event: "progress", payload: %{all: 5, done: 1, pending: 4, progress: 20.0}, topic: "mailing:f52c78c8-4148-4c2a-abaf-c91317ffcf7d"}
State: %{buffer: [], channels: %{"mailing:f52c78c8-4148-4c2a-abaf-c91317ffcf7d" => #PID<0.666.0>}, channels_inverse: %{#PID<0.666.0> => {"mailing:f52c78c8-4148-4c2a-abaf-c91317ffcf7d", "1"}}, client_ref: {#PID<0.622.0>, #Reference<0.3659197968.2859466756.205729>}, last_client_poll: 1527437359083, priv_topic: "phx:lp:oRFiAZoBxO6vqxRk/SFVjA==1527437358904", pubsub_server: Daten.PubSub, serializer: Phoenix.Transports.V2.LongPollSerializer, socket: %Phoenix.Socket{assigns: %{current_user: %Accounts.User{__meta__: #Ecto.Schema.Metadata<:loaded, "user">, account: %Accounts.Account{__meta__: #Ecto.Schema.Metadata<:loaded, "account">, id: "f52c78c8-4148-4c2a-abaf-c91317ffcf7d", inserted_at: #DateTime<2018-05-25 10:42:28.451558Z>, updated_at: #DateTime<2018-05-25 10:42:28.451570Z>}, email: "c@m", id: "f52c78c8-4148-4c2a-abaf-c91317ffcf7d", inserted_at: #DateTime<2018-05-25 10:42:28.456345Z>, name: "clemens", updated_at: #DateTime<2018-05-25 10:42:28.456352Z>, user_password: %Accounts.UserPassword{__meta__: #Ecto.Schema.Metadata<:loaded, "user_password">, id: 2, inserted_at: #DateTime<2018-05-25 10:42:28.457810Z>, password: nil, password_hash: "$argon2i$v=19$m=65536,t=6,p=1$UG2SFHp/2G7mhq+lGXVmgw$AOjJEKsj14GCfjhOWS/pmXCkWqmTWYcSfnV7WGZCbAQ", updated_at: #DateTime<2018-05-25 10:42:28.457817Z>, user: #Ecto.Association.NotLoaded<association :user is not loaded>, user_id: "f52c78c8-4148-4c2a-abaf-c91317ffcf7d"}}}, channel: nil, channel_pid: nil, endpoint: DatenWeb.Endpoint, handler: DatenWeb.UserSocket, id: "mailing:f52c78c8-4148-4c2a-abaf-c91317ffcf7d", join_ref: nil, joined: false, private: %{}, pubsub_server: Daten.PubSub, ref: nil, serializer: Phoenix.Transports.V2.LongPollSerializer, topic: nil, transport: Phoenix.Transports.LongPoll, transport_name: :longpoll, transport_pid: #PID<0.660.0>, vsn: "2.0.0"}, window_ms: 15000}
Note that sending the message using a websocket works perfectly, this is just happening when trying to do a long poll. Is this a legitimate bug, or am I missing something regarding how longpolling is implemented?
Thanks a lot
First Post!
OvermindDL1
This seems like a bug, the long poller is not handling the broadcast message, I’d say report it as an issue on github.
Popular in Questions
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible.
total = 10
while total != 0
...
New
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
I have a phoenix application from which a user can download multiple(5-6) files of size 1MB. I couldn’t find anything related to sending ...
New
I’m working on defining a simple Ecto schema for a table (in PostGres), but I don’t see where I can define a column as NOT NULL. Conside...
New
Hey all,
I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
I’m trying to make a websocket server in Phoenix or raw Elixir. I heard about gun, I think I could use cowboy, but since I’m not that sma...
New
In templates/appointment/index.html.eex:
<%= for appointment <- @appointments do %>
<tr>
<td><%= appoi...
New
I’m brand new to Phoenix and I have stripped one of the demo applications to the bone. I just want to get an svg up on the screen. Here i...
New
If I have a string “1000 cfu/ml” . I want to remove the characters and / and space . So the string is like this
"1000"
What is the ...
New
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New
Other popular topics
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
New
lets say i have a sample like
a = 20; b = 10;
if (a > b) do
{:ok, "a"}
end
if (a < b) do
{:ok, b}
end
if (a == b) do
{:ok, "equa...
New
What learn first? Rust or Elixir
Hi Elixir community!
I’m here because i want learn a new language. I’m a junior developer and mainly i ...
New
Hi guys, i’m new in the Elixir world, and i have to say, that i love it!
i’m having some problem to understand anonymous functions with ...
New
i’m a new one to elixir
which editor can i use
vs code? or atom?
Thanks! :smiley:
New
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
I am trying to run a deploy with docker and I successfully runned with this command:
docker build -t romenigld/blog-prod .
but when I t...
New
I would like to know what is the best IDE for elixir development?
New
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New
Hi!
Currently I want to submit a form by pressing the Enter key. However, since my input field is of type “textarea” this is just adds a...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance








