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

Pass along CONNECTED errors #291

Merged
merged 2 commits into from
Jun 22, 2016
Merged

Pass along CONNECTED errors #291

merged 2 commits into from
Jun 22, 2016

Conversation

SimonWoolf
Copy link
Member

Was putting this off until the untilAttach, but pulled forward due to https://github.com/ably/realtime/issues/589

For connected errors in upgrades, I did the workaround described in https://github.com/ably/realtime/issues/587#issuecomment-227158648 - ie syncing with the new (-1) connectionSerial after a failed upgrade. This is a bit hacky, but fixes the problem from that issue for now. If we decide to change realtime behaviour (eg to not require a sync in the case of a failed upgrade), then we can change it then.

This was referenced Jun 22, 2016
test.equal(stateChange.reason.code, 80008, "verify unrecoverable-connection error set in stateChange.reason");
test.equal(realtime.connection.errorReason.code, 80008, "verify unrecoverable-connection error set in connection.errorReason");
test.equal(realtime.connection.serial, -1, "verify serial is -1 (new connection), not 5");
test.equal(realtime.connection.key.indexOf('aaaaaaaaaaaaaaaa'), -1, "verify connection using a new connectionkey");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand the aaaaaaaaaaaaaa

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

argh oops. Right before I put this up I decided to change the fake recovery key from aaaaa!aaaaaaaaaaaaaaaa-aaaaaaa:5 to _____!ablyjs_test_fake-key____:5 (to make it obvious to anyone looking in the realtime sandbox logs and seeing failed resumes what was going on). Forgot to change that line :(

@paddybyers
Copy link
Member

LGTM except for one comment

…erial

Resetting the message serial is a bit of a hack - fixes the problem for
now but may change in the future depending on the conclusion of
ably/realtime#587
@SimonWoolf SimonWoolf merged commit c42255d into master Jun 22, 2016
SimonWoolf added a commit that referenced this pull request Jun 22, 2016
@SimonWoolf SimonWoolf deleted the connected-errors branch October 11, 2017 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants