Skip to content

Commit

Permalink
Merge branch 'r2.2.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
pl committed May 28, 2014
2 parents d691a78 + 8eabb31 commit 4de31e2
Show file tree
Hide file tree
Showing 12 changed files with 45 additions and 42 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.markdown
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 2.2.1 (2014-05-28)

[FIXED] Exception triggered by ping being sent when disconnected

## 2.2.0 (2014-04-14)

No changes since 2.2.0-rc3, just changed the version number.
Expand Down
2 changes: 1 addition & 1 deletion JFile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ target_dir './dist'

src_dir './src'

version '2.2.0'
version '2.2.1'

bundle 'pusher.js' do
license 'pusher-licence.js'
Expand Down
2 changes: 1 addition & 1 deletion dist/flashfallback.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Pusher JavaScript Library v2.2.0
* Pusher JavaScript Library v2.2.1
* http://pusherapp.com/
*
* Copyright 2011, Pusher
Expand Down
2 changes: 1 addition & 1 deletion dist/flashfallback.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions dist/pusher.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*!
* Pusher JavaScript Library v2.2.0
* http://pusherapp.com/
* Pusher JavaScript Library v2.2.1
* http://pusher.com/
*
* Copyright 2013, Pusher
* Copyright 2014, Pusher
* Released under the MIT licence.
*/

Expand Down Expand Up @@ -626,7 +626,7 @@
}).call(this);

;(function() {
Pusher.VERSION = '2.2.0';
Pusher.VERSION = '2.2.1';
Pusher.PROTOCOL = 7;

// DEPRECATED: WS connection parameters
Expand Down Expand Up @@ -3223,7 +3223,7 @@
});
Pusher.Network.bind("offline", function() {
self.timeline.info({ netinfo: "offline" });
if (self.state === "connected") {
if (self.connection) {
self.sendActivityCheck();
}
});
Expand Down Expand Up @@ -3321,7 +3321,6 @@
this.abortConnecting();
this.clearRetryTimer();
this.clearUnavailableTimer();
this.stopActivityCheck();
if (this.connection) {
var connection = this.abandonConnection();
connection.close();
Expand Down Expand Up @@ -3501,6 +3500,7 @@
if (!this.connection) {
return;
}
this.stopActivityCheck();
for (var event in this.connectionCallbacks) {
this.connection.unbind(event, this.connectionCallbacks[event]);
}
Expand Down
26 changes: 13 additions & 13 deletions dist/pusher.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions dist/xdr.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*!
* Pusher JavaScript Library v2.2.0
* http://pusherapp.com/
* Pusher JavaScript Library v2.2.1
* http://pusher.com/
*
* Copyright 2013, Pusher
* Copyright 2014, Pusher
* Released under the MIT licence.
*/

Expand Down
6 changes: 3 additions & 3 deletions dist/xdr.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions dist/xhr.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*!
* Pusher JavaScript Library v2.2.0
* http://pusherapp.com/
* Pusher JavaScript Library v2.2.1
* http://pusher.com/
*
* Copyright 2013, Pusher
* Copyright 2014, Pusher
* Released under the MIT licence.
*/

Expand Down
6 changes: 3 additions & 3 deletions dist/xhr.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 5 additions & 6 deletions spec/javascripts/unit/connection/connection_manager_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ describe("ConnectionManager", function() {
handshake = {
action: "connected",
connection: connection,
activityTimeout: 999999
activityTimeout: 500
};
strategy._callback(null, handshake);
});
Expand Down Expand Up @@ -371,8 +371,7 @@ describe("ConnectionManager", function() {
it("should clean up the activity check", function() {
jasmine.Clock.tick(10000);
// if activity check had worked, it would have sent a ping message
expect(connection.send).not.toHaveBeenCalled();
expect(connection.send_event).not.toHaveBeenCalled();
expect(connection.ping).not.toHaveBeenCalled();
});
});

Expand All @@ -391,13 +390,13 @@ describe("ConnectionManager", function() {

describe("on activity timeout", function() {
it("should send a ping", function() {
jasmine.Clock.tick(3455);
jasmine.Clock.tick(499);
expect(connection.ping).not.toHaveBeenCalled();

jasmine.Clock.tick(1);
expect(connection.ping).toHaveBeenCalled();

jasmine.Clock.tick(2344);
jasmine.Clock.tick(999);
expect(connection.close).not.toHaveBeenCalled();

connection.emit("activity");
Expand All @@ -407,7 +406,7 @@ describe("ConnectionManager", function() {
});

it("should close the connection after pong timeout", function() {
jasmine.Clock.tick(3456);
jasmine.Clock.tick(500);
expect(connection.close).not.toHaveBeenCalled();
jasmine.Clock.tick(2345);
expect(connection.close).toHaveBeenCalled();
Expand Down
Loading

0 comments on commit 4de31e2

Please sign in to comment.