Comparing version 0.8.34 to 0.8.35
{ | ||
"name": "Ably", | ||
"version": "0.8.34", | ||
"version": "0.8.35", | ||
"homepage": "https://www.ably.io/", | ||
@@ -5,0 +5,0 @@ "authors": [ |
/** | ||
* @license Copyright 2016, Ably | ||
* | ||
* Ably JavaScript Library v0.8.34 | ||
* Ably JavaScript Library v0.8.35 | ||
* https://github.com/ably/ably-js | ||
@@ -6,0 +6,0 @@ * |
@@ -22,3 +22,3 @@ Defaults.protocolVersion = 1; | ||
Defaults.version = '0.8.34'; | ||
Defaults.version = '0.8.35'; | ||
Defaults.libstring = 'js-' + Defaults.version; | ||
@@ -25,0 +25,0 @@ Defaults.apiVersion = '0.8'; |
@@ -48,2 +48,4 @@ "use strict"; | ||
code === 'ENOTFOUND' || | ||
code === 'ECONNRESET' || | ||
code === 'ECONNREFUSED' || | ||
(statusCode >= 500 && statusCode <= 504); | ||
@@ -50,0 +52,0 @@ } |
{ | ||
"name": "ably", | ||
"description": "Realtime client library for Ably.io, the realtime messaging service", | ||
"version": "0.8.34", | ||
"version": "0.8.35", | ||
"main": "./nodejs/index.js", | ||
@@ -6,0 +6,0 @@ "dependencies": { |
# [Ably](https://www.ably.io) | ||
## Version: 0.8.34 | ||
## Version: 0.8.35 | ||
@@ -5,0 +5,0 @@ [![Build Status](https://travis-ci.org/ably/ably-js.png)](https://travis-ci.org/ably/ably-js) |
@@ -20,2 +20,4 @@ { | ||
"40013": "Invalid message data or encoding", | ||
"40014": "Resource disposed", | ||
"40020": "Batch error", | ||
@@ -32,6 +34,10 @@ /* 401 codes */ | ||
"40120": "application disabled", | ||
"40130": "key disabled", | ||
"40130": "key error (unspecified)", | ||
"40131": "key revoked", | ||
"40132": "key expired", | ||
"40140": "token expired", | ||
"40133": "key disabled", | ||
"40140": "token error (unspecified)", | ||
"40141": "token revoked", | ||
"40142": "token expired", | ||
"40143": "token unrecognised", | ||
"40150": "connection blocked (limits exceeded)", | ||
@@ -99,6 +105,8 @@ "40160": "operation not permitted with provided capability", | ||
"90006": "unable to recover channel (unbounded request)", | ||
"90007": "channel operation failed (no response from server)", | ||
"91000": "unable to enter presence channel (no clientId)", | ||
"91001": "unable to enter presence channel (invalid channel state)", | ||
"91002": "unable to leave presence channel that is not entered", | ||
"91003": "unable to enter presence channel (maximum member limit exceeded)", | ||
"91100": "member implicitly left presence channel (connection closed)" | ||
} |
{ | ||
"_post_apps": "/* JSON body using in POST sandbox-rest.ably.io/apps request to set up the Test app */", | ||
"post_apps": { | ||
"limits": { "presence": { "maxMembers": 250 } }, | ||
"keys": [ | ||
@@ -5,0 +6,0 @@ {}, |
@@ -109,3 +109,3 @@ "use strict"; | ||
for(var i = numMessages; i > 0; i--) { | ||
setTimeout(publishIntervalHelper(i, channel, dataFn, onPublish), 20*i); | ||
setTimeout(publishIntervalHelper(i, channel, dataFn, onPublish), 2*i); | ||
} | ||
@@ -115,31 +115,110 @@ }; | ||
/* Authenticate with a clientId and explicitly provide the same clientId in the Message | ||
and ensure it is published */ | ||
exports.test = function(test) { | ||
var count = 10; | ||
var cbCount = 10; | ||
var checkFinish = function() { | ||
if(count <= 0 && cbCount <= 0) { | ||
function _multiple_send(test, text, iterations, delay) { | ||
if(!Crypto) { | ||
test.ok(false, 'Encryption not supported'); | ||
test.done(); | ||
return; | ||
} | ||
var realtime = helper.AblyRealtime({ useBinaryProtocol: !text}); | ||
test.expect(iterations + 3); | ||
var channelName = 'multiple_send_' + (text ? 'text_' : 'binary_') + iterations + '_' + delay, | ||
channel = realtime.channels.get(channelName), | ||
messageText = 'Test message (' + channelName + ')'; | ||
Crypto.generateRandomKey(128, function(err, key) { | ||
channel.setOptions({cipher: {key: key}}, function(err) { | ||
if(err) { | ||
test.ok(false, 'Unable to set channel options; err = ' + displayError(err)); | ||
closeAndFinish(test, realtime); | ||
return; | ||
} | ||
test.equal(channel.channelOptions.cipher.algorithm, 'aes'); | ||
test.equal(channel.channelOptions.cipher.keyLength, 128); | ||
function sendAll(sendCb) { | ||
var sent = 0; | ||
var sendOnce = function() { | ||
channel.publish('event0', messageText); | ||
if(++sent == iterations) { | ||
sendCb(null); | ||
return; | ||
} | ||
setTimeout(sendOnce, delay); | ||
}; | ||
sendOnce(); | ||
} | ||
function recvAll(recvCb) { | ||
var received = 0; | ||
channel.subscribe('event0', function(msg) { | ||
test.ok(msg.data == messageText); | ||
if(++received == iterations) | ||
recvCb(null); | ||
}); | ||
} | ||
async.parallel([sendAll, recvAll], function(err) { | ||
if(err) { | ||
test.ok(false, 'Error sending messages; err = ' + displayError(err)); | ||
} | ||
test.ok('Verify all messages received'); | ||
closeAndFinish(test, realtime); | ||
}); | ||
}); | ||
}); | ||
} | ||
exports.pq = function(test) { | ||
test.expect(150); | ||
var realtime; | ||
try { | ||
console.log('===============') | ||
realtime = helper.AblyRealtime({ autoConnect: false, useBinaryProtocol: false, transports: ['xhr_polling', 'xhr_streaming'], log: {level: 4}, useTokenAuth: true, tls: false }); | ||
var channel = realtime.channels.get('publishQueued_' + String(Math.random()).substr(2)); | ||
async.parallel([ | ||
function(cb) { | ||
var expectedMsgNum = 0; | ||
channel.subscribe('event', function(msg) { | ||
var num = msg.data.num; | ||
test.ok(true, 'Received event ' + num); | ||
console.log("expected: ", expectedMsgNum, "actual", num) | ||
test.equal(expectedMsgNum, num, 'Event ' + num + ' was in the right order'); | ||
expectedMsgNum++; | ||
if(num === 49) cb(); | ||
}); | ||
}, | ||
function(cb) { | ||
var ackd = 0; | ||
var publish = function(i) { | ||
channel.publish('event', {num: i}, function(err) { | ||
test.ok(!err, 'successfully published ' + i + (err ? ' err was ' + displayError(err) : '')); | ||
ackd++; | ||
if(ackd === 50) cb(); | ||
}); | ||
if(i < 49) { | ||
setTimeout(function() { | ||
publish(i + 1); | ||
}, 20); | ||
} | ||
}; | ||
publish(0); | ||
}, | ||
function(cb) { | ||
realtime.connection.on('connected', function() { cb(); }); | ||
realtime.connection.connect(); | ||
} | ||
], function() { | ||
closeAndFinish(test, realtime); | ||
} | ||
}; | ||
var onPublish = function() { | ||
--cbCount; | ||
checkFinish(); | ||
}; | ||
var realtime = helper.AblyRealtime({"useBinaryProtocol": true}); | ||
test.expect(count); | ||
var channel = realtime.channels.get('publish '); | ||
/* subscribe to event */ | ||
channel.subscribe('event0', function() { | ||
test.ok(true, 'Received event0'); | ||
--count; | ||
checkFinish(); | ||
}); | ||
var dataFn = function() { return 'Hello world at: ' + new Date(); }; | ||
publishAtIntervals(count, channel, dataFn, onPublish); | ||
}); | ||
monitorConnection(test, realtime); | ||
} catch(e) { | ||
test.ok(false, 'test failed with exception: ' + e.stack); | ||
closeAndFinish(test, realtime); | ||
} | ||
}; | ||
for(var i=0; i<100; i++) { | ||
exports["repetition" + i] = exports.test; | ||
//exports.test = function(test) { _multiple_send(test, false, 20, 50); }; | ||
for(var i=0; i<10; i++) { | ||
exports["repetition" + i] = exports.pq; | ||
} | ||
@@ -146,0 +225,0 @@ |
window.__karma__ = { base: '../' }; | ||
window.__karma__.files = {"browser/static/ably-commonjs.js":true,"browser/static/ably-commonjs.noencryption.js":true,"browser/static/ably.js":true,"browser/static/ably.min.js":true,"browser/static/ably.noencryption.js":true,"browser/static/ably.noencryption.min.js":true,"browser/lib/util/base64.js":true,"node_modules/async/lib/async.js":true,"spec/common/globals/environment.js":true,"spec/common/globals/named_dependencies.js":true,"spec/common/modules/client_module.js":true,"spec/common/modules/shared_helper.js":true,"spec/common/modules/testapp_manager.js":true,"spec/common/modules/testapp_module.js":true,"spec/common/ably-common/test-resources/crypto-data-128.json":true,"spec/common/ably-common/test-resources/crypto-data-256.json":true,"spec/common/ably-common/test-resources/test-app-setup.json":true,"spec/support/browser_file_list.js":true,"spec/support/browser_setup.js":true,"spec/support/environment.vars.js":true,"spec/support/modules_helper.js":true,"spec/support/tear_down.js":true,"spec/support/test_helper.js":true,"spec/realtime/auth.test.js":true,"spec/realtime/channel.test.js":true,"spec/realtime/connection.test.js":true,"spec/realtime/connectivity.test.js":true,"spec/realtime/crypto.test.js":true,"spec/realtime/event_emitter.test.js":true,"spec/realtime/failure.test.js":true,"spec/realtime/history.test.js":true,"spec/realtime/init.test.js":true,"spec/realtime/message.test.js":true,"spec/realtime/presence.test.js":true,"spec/realtime/resume.test.js":true,"spec/realtime/tmp.test.js":true,"spec/realtime/upgrade.test.js":true,"spec/rest/auth.test.js":true,"spec/rest/capability.test.js":true,"spec/rest/defaults.test.js":true,"spec/rest/history.test.js":true,"spec/rest/http.test.js":true,"spec/rest/init.test.js":true,"spec/rest/message.test.js":true,"spec/rest/presence.test.js":true,"spec/rest/stats.test.js":true,"spec/rest/time.test.js":true,"spec/browser/connection.test.js":true,"spec/browser/simple.test.js":true}; | ||
window.__karma__.files = {"browser/static/ably-commonjs.js":true,"browser/static/ably-commonjs.noencryption.js":true,"browser/static/ably.js":true,"browser/static/ably.min.js":true,"browser/static/ably.noencryption.js":true,"browser/static/ably.noencryption.min.js":true,"browser/lib/util/base64.js":true,"node_modules/async/lib/async.js":true,"spec/common/globals/environment.js":true,"spec/common/globals/named_dependencies.js":true,"spec/common/modules/client_module.js":true,"spec/common/modules/shared_helper.js":true,"spec/common/modules/testapp_manager.js":true,"spec/common/modules/testapp_module.js":true,"spec/common/ably-common/test-resources/crypto-data-128.json":true,"spec/common/ably-common/test-resources/crypto-data-256.json":true,"spec/common/ably-common/test-resources/messages-encoding.json":true,"spec/common/ably-common/test-resources/test-app-setup.json":true,"spec/support/browser_file_list.js":true,"spec/support/browser_setup.js":true,"spec/support/environment.vars.js":true,"spec/support/modules_helper.js":true,"spec/support/tear_down.js":true,"spec/support/test_helper.js":true,"spec/realtime/auth.test.js":true,"spec/realtime/channel.test.js":true,"spec/realtime/connection.test.js":true,"spec/realtime/connectivity.test.js":true,"spec/realtime/crypto.test.js":true,"spec/realtime/event_emitter.test.js":true,"spec/realtime/failure.test.js":true,"spec/realtime/history.test.js":true,"spec/realtime/init.test.js":true,"spec/realtime/message.test.js":true,"spec/realtime/presence.test.js":true,"spec/realtime/resume.test.js":true,"spec/realtime/tmp.test.js":true,"spec/realtime/upgrade.test.js":true,"spec/rest/auth.test.js":true,"spec/rest/capability.test.js":true,"spec/rest/defaults.test.js":true,"spec/rest/history.test.js":true,"spec/rest/http.test.js":true,"spec/rest/init.test.js":true,"spec/rest/message.test.js":true,"spec/rest/presence.test.js":true,"spec/rest/stats.test.js":true,"spec/rest/time.test.js":true,"spec/browser/connection.test.js":true,"spec/browser/simple.test.js":true}; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2726674
150
56612