Skip to content

Commit

Permalink
Regenerate and release version 1.0.19
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonWoolf committed Nov 22, 2018
1 parent 2b1d5ee commit 0ec93ad
Show file tree
Hide file tree
Showing 15 changed files with 666 additions and 568 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

This contains only the most important and/or user-facing changes; for a full changelog, see the commit history.

## [1.0.19](https://github.com/ably/ably-js/tree/1.0.19) (2018-11-22)

- Expose rest#setLog method to change log level or handler at runtime
- Allow jsonp for REST requests even if allowComet is false
- Expose Rest.Message for node, for consistency with Realtime.Message
- Add updateOnAttached channel option to force 'update' event even if `resumed` is true
- Stop a clientId from forcing token auth (https://github.com/ably/ably-js/issues/542)
- Fix package bloat through mistaken node_modules_node6 includes (due to npm not correctly parsing .gitignore)

## [1.0.18](https://github.com/ably/ably-js/tree/1.0.18) (2018-09-27)

- Fix bug where connectionSerial was not getting reset after a resume failure (https://github.com/ably/ably-js/pull/540)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ However, we aim to be compatible with a much wider set of platforms and browsers

Ably-js has fallback mechanisms in order to be able to support older browsers; specifically it supports comet-based connections for browsers that do not support websockets, and this includes JSONP for browsers that do not support cross-origin XHR. Each of these fallback transport mechanisms is supported and tested on all the browsers we test against, even when those browsers do not themselves require those fallbacks. These mean that the library should be compatible with nearly any browser on most platforms. Any known browser incompatibilities can be found [here](https://github.com/ably/ably-js/issues?q=is%3Aissue+is%3Aopen+label%3A%22compatibility%22).

#### Version: 1.0.18
#### Version: 1.0.19

The latest stable version of the Ably Javascript client library is version: 1.0.18 .
The latest stable version of the Ably Javascript client library is version: 1.0.19 .

For complete API documentation, see the [Ably documentation](https://www.ably.io/documentation).

Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Ably",
"version": "1.0.18",
"version": "1.0.19",
"homepage": "https://www.ably.io/",
"authors": [
"Paddy Byers <[email protected]>",
Expand Down
2 changes: 1 addition & 1 deletion browser/fragments/license.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @license Copyright 2018, Ably
*
* Ably JavaScript Library v1.0.18
* Ably JavaScript Library v1.0.19
* https://github.com/ably/ably-js
*
* Ably Realtime Messaging
Expand Down
42 changes: 27 additions & 15 deletions browser/static/ably-commonjs.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @license Copyright 2018, Ably
*
* Ably JavaScript Library v1.0.18
* Ably JavaScript Library v1.0.19
* https://github.com/ably/ably-js
*
* Ably Realtime Messaging
Expand Down Expand Up @@ -4091,7 +4091,7 @@ Defaults.TIMEOUTS = {
};
Defaults.httpMaxRetryCount = 3;

Defaults.version = '1.0.18';
Defaults.version = '1.0.19';
Defaults.libstring = Platform.libver + Defaults.version;
Defaults.apiVersion = '1.0';

Expand Down Expand Up @@ -4189,6 +4189,11 @@ Defaults.normaliseOptions = function(options) {
options.useBinaryProtocol = Platform.preferBinary;
}

if(options.clientId) {
var headers = options.headers = options.headers || {};
headers['X-Ably-ClientId'] = options.clientId;
}

return options;
};

Expand Down Expand Up @@ -8514,8 +8519,7 @@ var Auth = (function() {
function useTokenAuth(options) {
return options.useTokenAuth ||
(!basicAuthForced(options) &&
(options.clientId ||
options.authCallback ||
(options.authCallback ||
options.authUrl ||
options.token ||
options.tokenDetails))
Expand All @@ -8536,12 +8540,10 @@ var Auth = (function() {
logAndValidateTokenAuthMethod(this.authOptions);
} else {
/* Basic auth */
if(options.clientId || !options.key) {
var msg = 'Cannot authenticate with basic auth' +
(options.clientId ? ' as a clientId implies token auth' :
(!options.key ? ' as no key was given' : ''));
Logger.logAction(Logger.LOG_ERROR, 'Auth()', msg);
throw new Error(msg);
if(!options.key) {
var msg = 'Cannot authenticate with basic auth as no key was given';
Logger.logAction(Logger.LOG_ERROR, 'Auth()', msg);
throw new Error(msg);
}
Logger.logAction(Logger.LOG_MINOR, 'Auth()', 'anonymous, using basic auth');
this._saveBasicOptions(options);
Expand Down Expand Up @@ -9341,6 +9343,10 @@ var Rest = (function() {
}
};

Rest.prototype.setLog = function(logOptions) {
Logger.setLog(logOptions.level, logOptions.handler);
};

function Channels(rest) {
this.rest = rest;
this.attached = {};
Expand Down Expand Up @@ -9396,7 +9402,10 @@ var Realtime = (function() {
this.realtime = realtime;
this.all = {};
this.inProgress = {};
realtime.connection.connectionManager.on('transport.active', this.onTransportActive.bind(this));
var self = this;
realtime.connection.connectionManager.on('transport.active', function() {
self.onTransportActive();
});
}
Utils.inherits(Channels, EventEmitter);

Expand Down Expand Up @@ -9973,10 +9982,11 @@ var RealtimeChannel = (function() {
this.attachSerial = message.channelSerial;
this._mode = message.getMode();
if(this.state === 'attached') {
if(!message.hasFlag('RESUMED')) {
var resumed = message.hasFlag('RESUMED');
if(!resumed || this.channelOptions.updateOnAttached) {
/* On a loss of continuity, the presence set needs to be re-synced */
this.presence.onAttached(message.hasFlag('HAS_PRESENCE'))
var change = new ChannelStateChange(this.state, this.state, false, message.error);
var change = new ChannelStateChange(this.state, this.state, resumed, message.error);
this.emit('update', change);
}
} else {
Expand Down Expand Up @@ -10346,7 +10356,7 @@ var RealtimePresence = (function() {
}

Logger.logAction(Logger.LOG_MICRO, 'RealtimePresence.' + action + 'Client()',
action + 'ing; channel = ' + channel.name + ', client = ' + clientId || '(implicit) ' + getClientId(this));
'channel = ' + channel.name + ', client = ' + (clientId || '(implicit) ' + getClientId(this)));

var presence = PresenceMessage.fromValues({
action : action,
Expand Down Expand Up @@ -11272,6 +11282,8 @@ var JSONPTransport = (function() {
};
if(JSONPTransport.isAvailable()) {
ConnectionManager.supportedTransports[shortName] = JSONPTransport;
}
if(Platform.jsonpSupported) {
head = document.getElementsByTagName('head')[0];
}

Expand Down Expand Up @@ -11414,7 +11426,7 @@ var JSONPTransport = (function() {
this.emit('disposed');
};

if(!Http.Request) {
if(Platform.jsonpSupported && !Http.Request) {
Http.Request = function(rest, uri, headers, params, body, callback) {
var req = createRequest(uri, headers, params, body, CometTransport.REQ_SEND, rest && rest.options.timeouts);
req.once('complete', callback);
Expand Down
50 changes: 33 additions & 17 deletions browser/static/ably-commonjs.noencryption.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @license Copyright 2018, Ably
*
* Ably JavaScript Library v1.0.18
* Ably JavaScript Library v1.0.19
* https://github.com/ably/ably-js
*
* Ably Realtime Messaging
Expand Down Expand Up @@ -2659,7 +2659,7 @@ Defaults.TIMEOUTS = {
};
Defaults.httpMaxRetryCount = 3;

Defaults.version = '1.0.18';
Defaults.version = '1.0.19';
Defaults.libstring = Platform.libver + Defaults.version;
Defaults.apiVersion = '1.0';

Expand Down Expand Up @@ -2757,6 +2757,11 @@ Defaults.normaliseOptions = function(options) {
options.useBinaryProtocol = Platform.preferBinary;
}

if(options.clientId) {
var headers = options.headers = options.headers || {};
headers['X-Ably-ClientId'] = options.clientId;
}

return options;
};

Expand Down Expand Up @@ -4962,11 +4967,15 @@ var ConnectionManager = (function() {
/* TODO remove below line once realtime sends token errors as DISCONNECTEDs */
if(state === 'failed' && Auth.isTokenErr(error)) { state = 'disconnected' }
this.notifyState({state: state, error: error});
} else if(wasActive && (state === 'disconnected')) {
} else if(wasActive && (state === 'disconnected') && (this.state !== this.states.synchronizing)) {
/* If we were active but there is another transport scheduled for
* activation, go into to the connecting state until that transport
* activates and sets us back to connected. (manually starting the
* transition timers in case that never happens) */
* transition timers in case that never happens). (If we were in the
* synchronizing state, then that's fine, the old transport just got its
* disconnected before the new one got the sync -- ignore it and keep
* waiting for the sync. If it fails we have a separate sync timer that
* will expire). */
Logger.logAction(Logger.LOG_MICRO, 'ConnectionManager.deactivateTransport()', 'wasActive but another transport is connected and scheduled for activation, so going into the connecting state until it activates');
this.startSuspendTimer();
this.startTransitionTimer(this.states.connecting);
Expand Down Expand Up @@ -7078,8 +7087,7 @@ var Auth = (function() {
function useTokenAuth(options) {
return options.useTokenAuth ||
(!basicAuthForced(options) &&
(options.clientId ||
options.authCallback ||
(options.authCallback ||
options.authUrl ||
options.token ||
options.tokenDetails))
Expand All @@ -7100,12 +7108,10 @@ var Auth = (function() {
logAndValidateTokenAuthMethod(this.authOptions);
} else {
/* Basic auth */
if(options.clientId || !options.key) {
var msg = 'Cannot authenticate with basic auth' +
(options.clientId ? ' as a clientId implies token auth' :
(!options.key ? ' as no key was given' : ''));
Logger.logAction(Logger.LOG_ERROR, 'Auth()', msg);
throw new Error(msg);
if(!options.key) {
var msg = 'Cannot authenticate with basic auth as no key was given';
Logger.logAction(Logger.LOG_ERROR, 'Auth()', msg);
throw new Error(msg);
}
Logger.logAction(Logger.LOG_MINOR, 'Auth()', 'anonymous, using basic auth');
this._saveBasicOptions(options);
Expand Down Expand Up @@ -7905,6 +7911,10 @@ var Rest = (function() {
}
};

Rest.prototype.setLog = function(logOptions) {
Logger.setLog(logOptions.level, logOptions.handler);
};

function Channels(rest) {
this.rest = rest;
this.attached = {};
Expand Down Expand Up @@ -7960,7 +7970,10 @@ var Realtime = (function() {
this.realtime = realtime;
this.all = {};
this.inProgress = {};
realtime.connection.connectionManager.on('transport.active', this.onTransportActive.bind(this));
var self = this;
realtime.connection.connectionManager.on('transport.active', function() {
self.onTransportActive();
});
}
Utils.inherits(Channels, EventEmitter);

Expand Down Expand Up @@ -8537,10 +8550,11 @@ var RealtimeChannel = (function() {
this.attachSerial = message.channelSerial;
this._mode = message.getMode();
if(this.state === 'attached') {
if(!message.hasFlag('RESUMED')) {
var resumed = message.hasFlag('RESUMED');
if(!resumed || this.channelOptions.updateOnAttached) {
/* On a loss of continuity, the presence set needs to be re-synced */
this.presence.onAttached(message.hasFlag('HAS_PRESENCE'))
var change = new ChannelStateChange(this.state, this.state, false, message.error);
var change = new ChannelStateChange(this.state, this.state, resumed, message.error);
this.emit('update', change);
}
} else {
Expand Down Expand Up @@ -8910,7 +8924,7 @@ var RealtimePresence = (function() {
}

Logger.logAction(Logger.LOG_MICRO, 'RealtimePresence.' + action + 'Client()',
action + 'ing; channel = ' + channel.name + ', client = ' + clientId || '(implicit) ' + getClientId(this));
'channel = ' + channel.name + ', client = ' + (clientId || '(implicit) ' + getClientId(this)));

var presence = PresenceMessage.fromValues({
action : action,
Expand Down Expand Up @@ -9836,6 +9850,8 @@ var JSONPTransport = (function() {
};
if(JSONPTransport.isAvailable()) {
ConnectionManager.supportedTransports[shortName] = JSONPTransport;
}
if(Platform.jsonpSupported) {
head = document.getElementsByTagName('head')[0];
}

Expand Down Expand Up @@ -9978,7 +9994,7 @@ var JSONPTransport = (function() {
this.emit('disposed');
};

if(!Http.Request) {
if(Platform.jsonpSupported && !Http.Request) {
Http.Request = function(rest, uri, headers, params, body, callback) {
var req = createRequest(uri, headers, params, body, CometTransport.REQ_SEND, rest && rest.options.timeouts);
req.once('complete', callback);
Expand Down
Loading

0 comments on commit 0ec93ad

Please sign in to comment.