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

Incorrect error shown in clients when account limits are hit #57

Closed
mattheworiordan opened this issue Jun 27, 2015 · 4 comments
Closed
Assignees
Labels
bug Something isn't working. It's clear that this does need to be fixed. failing-test Where an automated test is failing either locally or in CI. Perhaps flakey, wrong or bug.

Comments

@mattheworiordan
Copy link
Member

I am testing a local server and when I connect with the ably-js client library, the error shown is:

Ably: Rest(): started
Ably: Auth(): anonymous, using basic auth
Ably: Realtime.ConnectionManager(): started
Ably: Connection.connect():
Ably: ConnectionManager.requestState(): requested state: connecting
Ably: ConnectionManager.cancelTransitionTimer():
Ably: ConnectionManager.enactStateChange: setting new state: connecting; reason = undefined
Ably: ConnectionManager.connectImpl(): starting connection
Ably: ConnectionManager.startTransitionTimer(): transitionState: [object Object]
Ably: ConnectionManager.chooseTransport():
Ably: ConnectionManager.chooseTransport(): Transport recovery mode = clean
Ably: CometTransport.connect(): starting
Ably: CometTransport.connect(): uri: https://local-rest.ably.io:443/comet/connect
Ably: CometTransport.connect(): connectParams:?key=hG9k8g.5BC1rQ%3AyzNeBJDVGA1QuAKa
Ably: ConnectionManager.chooseTransport(): Unexpected error establishing transport; err = {"statusCode":404,"code":80000}
Ably: ConnectionManager.connectImpl(): Error: Unable to connect (no available host)
Ably: ConnectionManager.notifyState(): new state: disconnected
Ably: ConnectionManager.cancelTransitionTimer():
Ably: ConnectionManager.enactStateChange: setting new state: disconnected; reason = Unable to connect (no available host)

However, when I connect using a telnet session to see what is actually exchanged, I see the following:

$ telnet localhost 80
Connected to localhost.
Escape character is '^]'.
GET /?access_token=hG9k8g.C8WNMrAhOZ_1n7oNYqKvrzGbGnbySjpz5OPyWcwJHGTq_ZctT-dTNIItzuZ7WK88i7eOo4Yog2dG62-WqmGZ2uHFHOuLY9N0oGgLMOgYwT9c&format=json&echo=true HTTP/1.1
Connection: Upgrade
Upgrade: websocket
Host: localhost:80
Origin: localhost:80
Sec-WebSocket-Version: 13
Sec-WebSocket-Key: MTMtMTQzMzM0Nzg3NTU5OA==

HTTP/1.1 101 Switching Protocols
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Accept: 0GFCTfIbbrcN75iYRZrkF7ykWMo=

{"action":9,"error":{"message":"account blocked (message limits exceeded)","code":40112,"statusCode":401}}

I suspect this is really an ably-js issue and not a realtime issue, but I wanted to raise it here first. We need to ensure clients are shown the correct error messages, especially for problems like this.

@mattheworiordan mattheworiordan added the bug Something isn't working. It's clear that this does need to be fixed. label Jun 27, 2015
@paddybyers
Copy link
Member

This issue is address with this fix: 72bb7d8

@mattheworiordan mattheworiordan added the failing-test Where an automated test is failing either locally or in CI. Perhaps flakey, wrong or bug. label Aug 21, 2015
@SimonWoolf SimonWoolf self-assigned this Sep 8, 2015
@SimonWoolf
Copy link
Member

@me to add realtime test/limits

@SimonWoolf
Copy link
Member

realtime test for emitting this error already exists: https://github.com/ably/realtime/blob/master/test/realtime/limits.js#L725-L795. (And per discussion yesterday: don't see how an ably-js test for this could work given afaik you can't specify an account limit for simulation apps -- unless we want to start having tests that mock out http responses..?).

@paddybyers
Copy link
Member

Closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working. It's clear that this does need to be fixed. failing-test Where an automated test is failing either locally or in CI. Perhaps flakey, wrong or bug.
Development

No branches or pull requests

3 participants