-
Notifications
You must be signed in to change notification settings - Fork 75
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
Unsubscribe some times do not send subscriptionId #8
Comments
Hi @chengyin, Based on what you are saying, I understand that this doesn't happen all the time, but aleatory with some of them, right? |
@chengyin , Is there any chance you are trying to unsubscribe before having subscribed ? |
Thanks for the quick responses! First I do not believe I'm trying to unsubscribe before subscribing. Based on my understanding, the only time that could happen is when the server response is delayed:
I don't think that was happening in my case. Now, from my actual debugging. This line processes the subscription confirmation only if the response event is {
"join_ref": "1",
"ref": "2",
"topic": "__absinthe__:control",
"event": "phx_reply",
"payload": {
"status": "ok",
"response": {
"subscriptionId": "__absinthe__:doc:73031069"
}
}
} Notice I'm not sure what's the expected message form from absinthe. I searched the whole absinthe org on GitHub for {:absinthe, "1.4.1"},
{:absinthe_phoenix, "1.4.0"},
{:absinthe_ecto, "0.1.3"},
{:absinthe_plug, "1.4.0"}, I think absinthe has 1.4.2. Changelog didn't mention anything related. We have the latest everything else. |
That code is OK @chengyin, as it's the one that handles the incoming data. Subscriptions (as any other request) are sent using What it should be happening (I'm currently working on to remove this requirement), is that currently to cancel a subscription, the latest version of the notifier has to be passed to cancel, since it's the one that has subscriptionId set on it. This one is obtained in the onStart handler of the observer. This week I will release a new version where you won't need to pass the latest notifier (with subscriptionId set) in order to unsubscribe, it will be enough to pass any version of them. Meanwhile, you will have to store the notifier given in observer.onStart and use this one to unsubscribe. |
Thanks. Setting a breakpoint at the line you pointed did show me that I think saving |
Sorry I haven't created a small reproducible case. Wanted to start the conversation first.
I'm using subscription with apollo. I am trying to unsubscribe with the function returned by apollo's
subscribeToMore
. I see that call get passed into socket-apollo-link. Inspecting the WS frames I see that nosubscriptionId
is sent with the majority of the requests:Down below, there is a case where it is sent.
When no subscriptionId is provided it actually cause a server side error.
Part of the code:
The text was updated successfully, but these errors were encountered: