clemensm
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
Trending in Questions
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
So my question is quite simple and i have found no conclusive answer on forum, google or AI.
Should we use :erlang.float for Integer to ...
New
Hello,
I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New
apply_graft/2 doesn’t rewrite an add_many sub-workflow’s deps on an add step. Grafted jobs cancel with “upstream job was deleted”
Version...
New
Other Trending Topics
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve.
They are GUI (Emerge) and State management (S...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixirconf-us
- #ai
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 4- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
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.
clemensm
Thanks, just noticed your reply, I’ll open an issue on github.
nerdyworm
I ran into this same thing the other day. It seems to be fixed on phoenix master, but not in the current release. Not sure if it’s the same issue or not.
pull from github in your mix.exs file and let us know
clemensm
Thanks, that solved it. Should have thought about checking the current version myself