Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Malformed unsubscribe requests from @absinthe/socket causes GenServer crash. #59

Open
JonRowe opened this issue Jun 29, 2019 · 1 comment

Comments

@JonRowe
Copy link

JonRowe commented Jun 29, 2019

Hi there, I'm using the @absinthe/socket node package to talk to my subscriptions server side, but upon cleanup, (I'm not sure exactly how, I think its navigating away before requests are finished (or possibly evening starting)) its sending an unsubscribe request for the control channel without a subscription id, which crashes out because handle_in only handles "unsubscribe" for a specific connection id, despite the fact it could handle the socket cleanup without one.

Would you welcome a PR to fix this?

@JonRowe
Copy link
Author

JonRowe commented Jun 29, 2019

GenServer terminating (FunctionClauseError): no function clause matching in Absinthe.Phoenix.Channel.handle_in/3 (Most recent call last)
File lib/absinthe/phoenix/channel.ex line 41 in Absinthe.Phoenix.Channel.handle_in/3 (absinthe_phoenix) args
  Absinthe.Phoenix.Channel.handle_in/3 (absinthe_phoenix) arguments
0 ""unsubscribe""
1 "%{}"
2 "%Phoenix.Socket{assigns: %{absinthe_pipeline: nil, absinthe_schema: MyApp.GraphQL.Schema, absinthe: %{opts: [context: %{id: "some_data", pubsub: MyApp.Endpoint}], pipeline: {Absinthe.Phoenix.Channel, :default_pipeline}, schema: MyApp.GraphQL.Schema}}, channel: Absinthe.Phoenix.Channel, channel_pid: #PID<0.915.0>, endpoint: MyApp.Endpoint, handler: MyApp.Socket, id: nil, join_ref: "1", joined: true, private: %{log_handle_in: :debug, log_join: :info}, pubsub_server: MyApp.PubSub, ref: "5", serializer: Phoenix.Transports.V2.WebSocketSerializer, topic: "absinthe:control", transport: Phoenix.Transports.WebSocket, transport_name: :websocket, transport_pid: #PID<0.914.0>, vsn: "2.0.0"}"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant