Skip to content
This repository has been archived by the owner on Apr 14, 2023. It is now read-only.

INIT_FAIL message appears to not be properly formatted #88

Closed
hmaurer opened this issue Mar 3, 2017 · 4 comments
Closed

INIT_FAIL message appears to not be properly formatted #88

hmaurer opened this issue Mar 3, 2017 · 4 comments

Comments

@hmaurer
Copy link

hmaurer commented Mar 3, 2017

Hello,

I am completely new to this project so this may just be the fruit of my incompetence, but it would appear that the SubscriptionClient expect an INIT_FAIL message to contain a payload field, c.f.

this.connectionCallback(parsedMessage.payload.error);
.

However, it seems that the server sets the error property directly on the message and not under a payload field, c.f.

This lead to an error when I tried to use connectionCallback.

Furthermore, upon rejection of the connection and if connectionCallback was not specified (to avoid the error), the client kept trying to reconnect without any backoff delay or limit on the number of reconnects.

@hmaurer
Copy link
Author

hmaurer commented Mar 3, 2017

#53
@Urigo you might have an idea about this! :)

@Urigo
Copy link
Contributor

Urigo commented Mar 8, 2017

@hmaurer ohhhh very good catch!
it was actually caused by a few things (as you can see in the PR).
Fixed and added a test.

Thank you for that!

@hmaurer
Copy link
Author

hmaurer commented Mar 8, 2017

@Urigo The PR is quite instructive! Why was setTimeout required? (what message needs to be flushed and why?)

@Urigo
Copy link
Contributor

Urigo commented Mar 8, 2017

@hmaurer

// We are using setTimeout because we want the message to be flushed before
// disconnecting the client

The INIT_FAIL just doesn't get to the client!

baconz pushed a commit to PhiloInc/subscriptions-transport-ws that referenced this issue Apr 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants