From 754e1d4a7129316efb445b5dc502c7ab72c14f10 Mon Sep 17 00:00:00 2001 From: Alexey Orlenko Date: Tue, 14 Mar 2017 00:16:08 +0200 Subject: [PATCH 01/19] Working on v0.6.7 PR-URL: https://github.com/metarhia/JSTP/pull/101 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c35973f1..1820a580 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "metarhia-jstp", - "version": "0.6.6", + "version": "0.6.7", "author": "Timur Shemsedinov ", "description": "JavaScript Transfer Protocol for Impress Application Server", "license": "MIT", From dd52fb6b99741929c0cb2444d139e221b876278d Mon Sep 17 00:00:00 2001 From: Alexey Orlenko Date: Tue, 21 Feb 2017 01:34:07 +0200 Subject: [PATCH 02/19] doc: fix linter warning in CHANGELOG.md Remove an extra consecutive blank line in `CHANGELOG.md`. PR-URL: https://github.com/metarhia/JSTP/pull/80 --- CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ebd0a016..827ef3f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,7 +28,6 @@ Notable changes: *(Alexey Orlenko)* [#78](https://github.com/metarhia/JSTP/pull/78) - All changes: * **server:** clean internal structures on close From a79325e4c2b40bc74e79e12e0441cc7a862f264c Mon Sep 17 00:00:00 2001 From: Alexey Orlenko Date: Wed, 22 Feb 2017 15:10:32 +0200 Subject: [PATCH 03/19] tools: remove crlf.js from dot-ignore files This entry was copied from .gitignore file of Impress (as the whole file was copied) at some time in the beginning of the project. I guess, it had been used by @tshemsedinov long time ago, but now Impress itself doesn't have such entry in its ignore-files. The next step will be to review my `dev/` directory, remove the helpers that I don't need anymore and refactor the rest of them to publicly available tests and tools to be placed in the corresponding directories of the repository. PR-URL: https://github.com/metarhia/JSTP/pull/83 --- .gitignore | 1 - .npmignore | 1 - 2 files changed, 2 deletions(-) diff --git a/.gitignore b/.gitignore index 52844ecc..b3256aeb 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,6 @@ node_modules *.heapsnapshot # Development helpers -crlf.js dev/ # Project files diff --git a/.npmignore b/.npmignore index 0d7ee4cb..e1b62dab 100644 --- a/.npmignore +++ b/.npmignore @@ -4,7 +4,6 @@ *.heapsnapshot # Development helpers -crlf.js dev/ # Project files From 17430ebb6e69fd376fca514616f17467f3bd860c Mon Sep 17 00:00:00 2001 From: Alexey Orlenko Date: Wed, 22 Feb 2017 15:05:17 +0200 Subject: [PATCH 04/19] npm: don't include doc/ and mkdocs.yml to package PR-URL: https://github.com/metarhia/JSTP/pull/82 --- .npmignore | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.npmignore b/.npmignore index e1b62dab..ab05245a 100644 --- a/.npmignore +++ b/.npmignore @@ -13,8 +13,10 @@ dev/ # node-gyp build build/ -# Built docs +# Docs +doc/ site/ +mkdocs.yml # Python bytecode *.pyc From 82f21fbabe0064e0e22d0b3c5da6e4e90f5db864 Mon Sep 17 00:00:00 2001 From: Mykola Bilochub Date: Tue, 21 Feb 2017 22:08:53 +0200 Subject: [PATCH 05/19] doc: add session WG meeting PR-URL: https://github.com/metarhia/JSTP/pull/81 --- doc/meetings/2017-02-21-sessions.md | 65 +++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 doc/meetings/2017-02-21-sessions.md diff --git a/doc/meetings/2017-02-21-sessions.md b/doc/meetings/2017-02-21-sessions.md new file mode 100644 index 00000000..11b7c5a3 --- /dev/null +++ b/doc/meetings/2017-02-21-sessions.md @@ -0,0 +1,65 @@ +# Sessions WG meeting + +Date: 2017-02-21 + +### Invited: + + * Alexey Orlenko <eaglexrlnk@gmail.com> + ([@aqrln](https://github.com/aqrln)) from server team + * Mykola Bilochub <nbelochub@gmail.com> + ([@belochub](https://github.com/belochub)) from server team + * Denys Otrishko <shishugi@gmail.com> + ([@lundibundi](https://github.com/lundibundi)) from Android team + * Andrew Vysotskyi <firemaaaan@gmail.com> + ([@Gagnant](https://github.com/Gagnant)) from iOS team + +### Present: + + * Alexey Orlenko <eaglexrlnk@gmail.com> + ([@aqrln](https://github.com/aqrln)) from server team + * Mykola Bilochub <nbelochub@gmail.com> + ([@belochub](https://github.com/belochub)) from server team + * Denys Otrishko <shishugi@gmail.com> + ([@lundibundi](https://github.com/lundibundi)) from Android team + +### Agenda: + + * General way of reconnection to existing sessions; + * Session restoration mechanisms architecture; + * The problems with reconnection mobile developers encountered in our last + project and proper ways to solve them; + * Handshake packet formats (for request and response) that will be used to + implement reconnection to existing sessions. + +### Conclusions: + + * To make packet numbers unique for every session, not connection like it was before; + * To send total count of packets sent and received by each side during the session + in handshake packet, like this: + + ```javascript + { handshake: [0, 'appName'], session: ['sessionId', sent_count, received_count] } + ``` + + and answer + + ```javascript + { handshake: [0], ok: [sent_count, received_count] } + ``` + +### Post-discussion additions: + +1. Even though packet IDs are incremented throughout the session, not the + connection, handshake packets are always 0 since we don't know which packet + IDs to use until a handshake has been performed. After that, the order + continues as it should have been if there hadn't been reconnection, with an + extra handshake being transparent. + +2. The standard `ERR_AUTH_FAILED` error will be used for any handshake + authentication strategy, regardless of it being `login`, `session` or + anything we may probably add later. What it means for session restoration + handshakes is that if session ID is invalid, the server responds with + + ```javascript + { handshake: [0], error: [11] } + ``` From 57c10ae8b6d5c24a6964c95f89b2af2e95ecdfcd Mon Sep 17 00:00:00 2001 From: Alexey Orlenko Date: Sun, 26 Feb 2017 08:08:11 +0200 Subject: [PATCH 06/19] lint: update remark Update the Markdown linting tools. PR-URL: https://github.com/metarhia/JSTP/pull/87 --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 1820a580..0987cb6a 100644 --- a/package.json +++ b/package.json @@ -49,9 +49,9 @@ "karma-safari-launcher": "^1.0.0", "karma-webpack": "^2.0.1", "mocha": "^3.2.0", - "remark-cli": "^2.1.0", - "remark-lint": "^5.4.0", - "remark-validate-links": "^5.0.0", + "remark-cli": "^3.0.0", + "remark-lint": "^6.0.0", + "remark-validate-links": "^6.0.0", "webpack": "^2.2.1" }, "scripts": { From 9b2cac95dd5e0fd4ecdb63f7a7bdc807b903580d Mon Sep 17 00:00:00 2001 From: Alexey Orlenko Date: Sun, 26 Feb 2017 06:10:33 +0200 Subject: [PATCH 07/19] test: add Node.js 6.10 and 7.6 to .travis.yml PR-URL: https://github.com/metarhia/JSTP/pull/86 --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 2b39cd36..6141e579 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,12 +10,14 @@ node_js: - "6.7" - "6.8" - "6.9" + - "6.10" - "7.0" - "7.1" - "7.2" - "7.3" - "7.4" - "7.5" + - "7.6" env: - CXX=g++-6 addons: From de5ffe50038c7dea6d2c515e3721f8c645b86272 Mon Sep 17 00:00:00 2001 From: Alexey Orlenko Date: Sun, 26 Feb 2017 22:23:13 +0200 Subject: [PATCH 08/19] tools: move build-native.js to tools * Move `build-native.js` to `tools/` * Update the NPM scripts * Make `tools/build-native.js` executable PR-URL: https://github.com/metarhia/JSTP/pull/89 --- package.json | 4 ++-- build-native.js => tools/build-native.js | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) rename build-native.js => tools/build-native.js (98%) mode change 100644 => 100755 diff --git a/package.json b/package.json index 0987cb6a..d6884cbf 100644 --- a/package.json +++ b/package.json @@ -64,8 +64,8 @@ "lint": "eslint . && remark .", "install": "npm run rebuild-node", "build": "npm run build-node && npm run build-browser", - "build-node": "node build-native", - "rebuild-node": "node build-native --rebuild", + "build-node": "node tools/build-native", + "rebuild-node": "node tools/build-native --rebuild", "build-browser": "webpack --progress --colors", "prepublish": "npm run build-browser", "pretest": "npm run build-node" diff --git a/build-native.js b/tools/build-native.js old mode 100644 new mode 100755 similarity index 98% rename from build-native.js rename to tools/build-native.js index 1f20b7b5..765739db --- a/build-native.js +++ b/tools/build-native.js @@ -1,3 +1,5 @@ +#!/usr/bin/env node + 'use strict'; const fs = require('fs'); From 943bd799e92932d015ab9945ffc61460ffbb74a6 Mon Sep 17 00:00:00 2001 From: Alexey Orlenko Date: Sun, 26 Feb 2017 23:05:34 +0200 Subject: [PATCH 09/19] lib: make failed addon loading more informative * Make `common.safeRequire` print the reason of failed require() to stderr. The error wasn't passed anywhere so the reason was lost and could not be delivered to user. When the Record Serialization parser could not load its native addon, it always stated that it isn't built though the actual reason might be different. * Fix somewhat misleading language in the error message in `lib/record-serialization.js`. The addon is not only used on server. For example, when the addon was compiled with a wrong version of `node-gyp`, JSTP used to print: > JSTP native addon is not built. Run `npm install` in order to build > it, otherwise you will get poor server performance under load. and it continued to print the same message however many times `npm install` was invoked, which is certainly not very helpful. Now the error message in the same situation looks like this: > Error: The module > '/Users/alex/projects/metarhia/JSTP/build/Release/jstp.node' > was compiled against a different Node.js version using > NODE_MODULE_VERSION 51. This version of Node.js requires > NODE_MODULE_VERSION 53. Please try re-compiling or re-installing > the module (for instance, using `npm rebuild` or `npm install`). > Error: Cannot find module '../build/Debug/jstp' > JSTP native addon is not built or is not functional. Run `npm install` > in order to build it, otherwise you will get poor performance. and is certainly more helpful since it contains an obvious reference to ABI incompatibility and makes it possible to troubleshoot it. PR-URL: https://github.com/metarhia/JSTP/pull/90 --- lib/common.js | 1 + lib/record-serialization.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/common.js b/lib/common.js index 7ad4496f..8aa246d5 100644 --- a/lib/common.js +++ b/lib/common.js @@ -33,6 +33,7 @@ common.safeRequire = (moduleName) => { try { return require(moduleName); } catch (err) { + console.warn(err.toString()); return null; } }; diff --git a/lib/record-serialization.js b/lib/record-serialization.js index 3bc21330..37ebffc8 100644 --- a/lib/record-serialization.js +++ b/lib/record-serialization.js @@ -23,9 +23,9 @@ if (jstpNative) { } } else { console.warn( - 'JSTP native addon is not built. ' + + 'JSTP native addon is not built or is not functional. ' + 'Run `npm install` in order to build it, otherwise you will get ' + - 'poor server performance under load.' + 'poor performance.' ); module.exports = require('./record-serialization-fallback'); } From 506c223faa6f48af2b6e9390016db2767e2b0255 Mon Sep 17 00:00:00 2001 From: Alexey Orlenko Date: Thu, 2 Mar 2017 14:17:23 +0200 Subject: [PATCH 10/19] w3c-ws: emit missing error event PR-URL: https://github.com/metarhia/JSTP/pull/93 --- lib/transport.ws.browser.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/transport.ws.browser.js b/lib/transport.ws.browser.js index 1b0ffee2..167c761d 100644 --- a/lib/transport.ws.browser.js +++ b/lib/transport.ws.browser.js @@ -55,6 +55,7 @@ W3CWebSocketClient.prototype.connect = function(callback) { if (callback) { callback(error); } + this.emit('error', error); return; } From 5f6cd8ef8e37c50fd193446e025f30eb463b0766 Mon Sep 17 00:00:00 2001 From: Alexey Orlenko Date: Thu, 2 Mar 2017 14:28:40 +0200 Subject: [PATCH 11/19] w3c-ws: fix invalid property access s/connection/socketEventEmitter PR-URL: https://github.com/metarhia/JSTP/pull/94 --- lib/transport.ws.browser.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/transport.ws.browser.js b/lib/transport.ws.browser.js index 167c761d..ee2b0ae4 100644 --- a/lib/transport.ws.browser.js +++ b/lib/transport.ws.browser.js @@ -83,11 +83,9 @@ W3CWebSocketClient.prototype.connect = function(callback) { // W3CWebSocketClient.prototype.disconnect = function(callback) { transportCommon.ensureClientConnected(this); - if (callback) { - this.connection.once('close', callback); + this.socketEventEmitter.once('close', callback); } - this.socket.close(); }; From 9c8d9f3d9b5ace0079d9ca5258db6b3cd2c204d4 Mon Sep 17 00:00:00 2001 From: Alexey Orlenko Date: Thu, 2 Mar 2017 20:22:46 +0200 Subject: [PATCH 12/19] test: add Node.js 7.7 to .travis.yml PR-URL: https://github.com/metarhia/JSTP/pull/95 --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 6141e579..639cfb45 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,6 +18,7 @@ node_js: - "7.4" - "7.5" - "7.6" + - "7.7" env: - CXX=g++-6 addons: From 1ea34c6e9a6e917e3a6dd9e0309b5f9fd33b93f9 Mon Sep 17 00:00:00 2001 From: Alexey Orlenko Date: Fri, 3 Mar 2017 06:23:10 +0200 Subject: [PATCH 13/19] connection: change style of a forward declaration ESLint complains that a variable is never reassigned if it is declared like this: let variable; ... variable = value; Because of this, we had a forward declaration in `connection.js` marked with a directive for ESLint to ignore the line. This commit changes it to assignment to null. PR-URL: https://github.com/metarhia/JSTP/pull/96 --- lib/connection.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/connection.js b/lib/connection.js index ed6407ee..61e8d03e 100644 --- a/lib/connection.js +++ b/lib/connection.js @@ -16,7 +16,7 @@ let nextConnectionId = 0; // Mapping of packet types to handler function names (forward declaration, see // definition below the Connection class). // -let PACKET_HANDLERS; // eslint-disable-line prefer-const +let PACKET_HANDLERS = null; // JSTP connection class // transport - an abstract socket From bb86faa060236d2a056f2afb52bccf5221a5881e Mon Sep 17 00:00:00 2001 From: Alexey Orlenko Date: Fri, 3 Mar 2017 17:05:46 +0200 Subject: [PATCH 14/19] lib: change multiline function signatures style Make multiline function signatures more concise. PR-URL: https://github.com/metarhia/JSTP/pull/97 --- lib/applications.js | 6 +----- lib/client.js | 11 ++--------- lib/connection.js | 13 +++---------- 3 files changed, 6 insertions(+), 24 deletions(-) diff --git a/lib/applications.js b/lib/applications.js index ff0b2bc8..0b24d491 100644 --- a/lib/applications.js +++ b/lib/applications.js @@ -25,11 +25,7 @@ apps.Application = Application; // callback - method callback // Application.prototype.callMethod = function( - connection, - interfaceName, - methodName, - args, - callback + connection, interfaceName, methodName, args, callback ) { const appInterface = this.api[interfaceName]; if (!appInterface) { diff --git a/lib/client.js b/lib/client.js index d4533610..83236d98 100644 --- a/lib/client.js +++ b/lib/client.js @@ -76,10 +76,7 @@ Client.prototype.disconnect = function(callback) { // callback - callback function with signature (error, connection, sessionId) // Client.prototype.connectAndHandshake = function( - appName, - username, - password, - callback + appName, username, password, callback ) { this.connect((error, connection) => { if (error) { @@ -107,11 +104,7 @@ Client.prototype.connectAndHandshake = function( // (error, connection, sessionId, api) // Client.prototype.connectAndInspect = function( - appName, - username, - password, - interfaces, - callback + appName, username, password, interfaces, callback ) { this.connectAndHandshake( appName, username, password, (error, connection, sid) => { diff --git a/lib/connection.js b/lib/connection.js index 61e8d03e..4095053d 100644 --- a/lib/connection.js +++ b/lib/connection.js @@ -73,10 +73,7 @@ util.inherits(Connection, events.EventEmitter); // has been received // Connection.prototype.callMethod = function( - interfaceName, - methodName, - args, - callback + interfaceName, methodName, args, callback ) { const packet = this.createPacket('call', interfaceName, methodName, args); const packetId = packet.call[0]; @@ -110,9 +107,7 @@ Connection.prototype.callback = function(packetId, error, result) { // args - event arguments as an object // Connection.prototype.emitRemoteEvent = function( - interfaceName, - eventName, - args + interfaceName, eventName, args ) { const packet = this.createPacket('event', interfaceName, eventName, args); this._send(packet); @@ -591,9 +586,7 @@ Connection.prototype._processPongPacket = function(packet) { // result - data to send back as a result // Connection.prototype._remoteCallbackWrapper = function( - packetId, - error, - ...result + packetId, error, ...result ) { this.callback(packetId, error, result); }; From 1c48af0a3b9ef4c50c8742182159fd495a2a8577 Mon Sep 17 00:00:00 2001 From: Alexey Orlenko Date: Sun, 26 Feb 2017 20:32:53 +0200 Subject: [PATCH 15/19] tools: generate authors list automatically * Add new `update-authors.js` tool that traverses commit history using `git log` and creates authors list. * Decouple common functions into a module shared between tools. * Add `.mailmap` file. This file is automatically parsed by Git so that `git log --format='%aN <%aE>'` won't show duplicate entries in case something was committed with misconfigured Git. E.g., without this file @tshemsedinov appears twice in the list, as Timur Shemsedinov and as tshemsedinov, but with mailmap applied Git automatically coalesces these entries to use the full name only. This file now includes the active collaborators (@tshemsedinov for a reason and @aqrln and @belochub just in case), proper names and emails of contributors who committed with invalid ones should be placed here. PR-URL: https://github.com/metarhia/JSTP/pull/88 --- .mailmap | 3 +++ tools/common.js | 27 +++++++++++++++++++++++++++ tools/prepare-release.js | 24 ++---------------------- tools/update-authors.js | 22 ++++++++++++++++++++++ 4 files changed, 54 insertions(+), 22 deletions(-) create mode 100644 .mailmap create mode 100644 tools/common.js create mode 100755 tools/update-authors.js diff --git a/.mailmap b/.mailmap new file mode 100644 index 00000000..c68926c1 --- /dev/null +++ b/.mailmap @@ -0,0 +1,3 @@ +Timur Shemsedinov +Alexey Orlenko +Mykola Bilochub diff --git a/tools/common.js b/tools/common.js new file mode 100644 index 00000000..876a357a --- /dev/null +++ b/tools/common.js @@ -0,0 +1,27 @@ +// Common utilities used by tools +'use strict'; + +const childProcess = require('child_process'); +const fs = require('fs'); + +const common = {}; +module.exports = common; + +common.getCommandOutput = (cmd) => { + const exec = common.promisify(childProcess.exec); + return exec(cmd).then((stdout, stderr) => { + if (stderr) console.error(stderr); + return stdout; + }); +}; + +common.promisify = (fn) => (...args) => ( + new Promise((resolve, reject) => { + fn(...args, (error, ...result) => { + if (error) reject(error); + else resolve(...result); + }); + }) +); + +common.writeFile = common.promisify(fs.writeFile); diff --git a/tools/prepare-release.js b/tools/prepare-release.js index c8e11c20..eacc53ba 100755 --- a/tools/prepare-release.js +++ b/tools/prepare-release.js @@ -2,11 +2,11 @@ 'use strict'; -const childProcess = require('child_process'); -const fs = require('fs'); const https = require('https'); const path = require('path'); +const { getCommandOutput, writeFile } = require('./common'); + const commandName = path.relative('.', __filename); const help = `\ This tool allows to filter the result of @@ -83,14 +83,6 @@ getCommandOutput('git cherry ' + branch).then((cherryOut) => { process.exit(1); }); -function getCommandOutput(cmd) { - const exec = promisify(childProcess.exec); - return exec(cmd).then((stdout, stderr) => { - if (stderr) console.error(stderr); - return stdout; - }); -} - function getMetadata(commitHash) { const command = 'git log --format="%aN%n%B" -n 1 ' + commitHash; return getCommandOutput(command).then((output) => { @@ -188,17 +180,6 @@ function getStreamData(stream, callback) { stream.on('error', callback); } -function promisify(fn) { - return (...args) => ( - new Promise((resolve, reject) => { - fn(...args, (error, ...result) => { - if (error) reject(error); - else resolve(...result); - }); - }) - ); -} - function processCommits(commits) { commits = filterCommits(commits, maxLevel); @@ -233,7 +214,6 @@ function processCommits(commits) { script += '\n'; - const writeFile = promisify(fs.writeFile); return Promise.all([ writeFile(`${branch}-apply-commits.sh`, script), writeFile(`${branch}-commits.md`, changelog) diff --git a/tools/update-authors.js b/tools/update-authors.js new file mode 100755 index 00000000..c4ae6f09 --- /dev/null +++ b/tools/update-authors.js @@ -0,0 +1,22 @@ +#!/usr/bin/env node + +'use strict'; + +const path = require('path'); +const { getCommandOutput, writeFile } = require('./common'); + +const AUTHORS_PATH = path.resolve(__dirname, '..', 'AUTHORS'); + +getCommandOutput('git log --reverse --format="%aN <%aE>"').then((out) => { + const authors = []; + for (const author of out.split('\n')) { + if (!authors.includes(author)) { + authors.push(author); + } + } + return writeFile(AUTHORS_PATH, authors.join('\n')); +}).catch((error) => { + const message = error.stack || error.toString(); + console.error(message); + process.exit(1); +}); From bf114ad3c6e704870bbf33ca50ac8c8951c9bd6f Mon Sep 17 00:00:00 2001 From: Alexey Orlenko Date: Sun, 26 Feb 2017 20:45:47 +0200 Subject: [PATCH 16/19] meta: update AUTHORS and .mailmap * Add all the contributors using `tools/update-authors.js`. * Sort the mail map alphabetically. PR-URL: https://github.com/metarhia/JSTP/pull/88 --- .mailmap | 4 +++- AUTHORS | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.mailmap b/.mailmap index c68926c1..70bd2226 100644 --- a/.mailmap +++ b/.mailmap @@ -1,3 +1,5 @@ -Timur Shemsedinov Alexey Orlenko +Dmitry Borisov Mykola Bilochub +Timur Shemsedinov +Vlad Dziuba diff --git a/AUTHORS b/AUTHORS index c68926c1..5869cf4e 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,3 +1,6 @@ Timur Shemsedinov +Dmitry Borisov +Artem Chernenkiy Alexey Orlenko Mykola Bilochub +Vlad Dziuba From 7b6dd6fe912f4482ff373e457005fae76d5652c7 Mon Sep 17 00:00:00 2001 From: Alexey Orlenko Date: Tue, 28 Feb 2017 18:10:44 +0200 Subject: [PATCH 17/19] meta: fix misleading language in LICENSE PR-URL: https://github.com/metarhia/JSTP/pull/88 --- LICENSE | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/LICENSE b/LICENSE index 51146cca..379e78ea 100644 --- a/LICENSE +++ b/LICENSE @@ -3,9 +3,8 @@ JavaScript Transfer Protocol ("JSTP") is licensed for use as follows: """ MIT License -Copyright (c) 2016–2017 JSTP project authors -(see https://github.com/metarhia/JSTP/blob/master/AUTHORS for full list) -and other JSTP contributors. +Copyright (c) 2016–2017 JSTP contributors +(see https://github.com/metarhia/JSTP/blob/master/AUTHORS). Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From ba9874c258a3ffce2fe6e71707b920fa5e229ac9 Mon Sep 17 00:00:00 2001 From: Alexey Orlenko Date: Sun, 12 Mar 2017 14:51:22 +0200 Subject: [PATCH 18/19] connection: check that method arguments exist The common implementation of `application.callMethod()` involves checking `args.length` which leads to crash if `args` is null or undefined. This commit provides a quick-and-dirty patch for only this vulnerability until the common approach for message sanity checking will have been developed. PR-URL: https://github.com/metarhia/JSTP/pull/100 --- lib/connection.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/connection.js b/lib/connection.js index 4095053d..f42adb28 100644 --- a/lib/connection.js +++ b/lib/connection.js @@ -473,6 +473,10 @@ Connection.prototype._processCallPacket = function(packet, keys) { const callback = this._remoteCallbackWrapper.bind(this, packetId); + if (!args) { + return callback(errors.ERR_INVALID_SIGNATURE); + } + try { this.application.callMethod(this, interfaceName, methodName, args, callback); From dd238d904a847711b04a5811c4c408aeb14ea107 Mon Sep 17 00:00:00 2001 From: Alexey Orlenko Date: Tue, 14 Mar 2017 00:21:32 +0200 Subject: [PATCH 19/19] Version 0.6.7 This is a bugfix release. Notable changes: * lib: make failed addon loading more informative * w3c-ws: emit missing error event * w3c-ws: fix invalid property access * connection: check that method arguments exist PR-URL: https://github.com/metarhia/JSTP/pull/101 --- CHANGELOG.md | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 827ef3f9..169ab72f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,78 @@ # `metarhia-jstp` changelog +## Version 0.6.7 (2017-03-14, @aqrln) + +This is a bugfix release. + +Notable changes: + + * **lib:** make failed addon loading more informative + *(Alexey Orlenko)* + [#90](https://github.com/metarhia/JSTP/pull/90) + * **w3c-ws:** emit missing error event + *(Alexey Orlenko)* + [#93](https://github.com/metarhia/JSTP/pull/93) + * **w3c-ws:** fix invalid property access + *(Alexey Orlenko)* + [#94](https://github.com/metarhia/JSTP/pull/94) + * **connection:** check that method arguments exist + *(Alexey Orlenko)* + [#100](https://github.com/metarhia/JSTP/pull/100) + +All changes: + + * **doc:** fix linter warning in CHANGELOG.md + *(Alexey Orlenko)* + [#80](https://github.com/metarhia/JSTP/pull/80) + * **tools:** remove crlf.js from dot-ignore files + *(Alexey Orlenko)* + [#83](https://github.com/metarhia/JSTP/pull/83) + * **npm:** don't include doc/ and mkdocs.yml to package + *(Alexey Orlenko)* + [#82](https://github.com/metarhia/JSTP/pull/82) + * **doc:** add session WG meeting + *(Mykola Bilochub)* + [#81](https://github.com/metarhia/JSTP/pull/81) + * **lint:** update remark + *(Alexey Orlenko)* + [#87](https://github.com/metarhia/JSTP/pull/87) + * **test:** add Node.js 6.10 and 7.6 to .travis.yml + *(Alexey Orlenko)* + [#86](https://github.com/metarhia/JSTP/pull/86) + * **tools:** move build-native.js to tools + *(Alexey Orlenko)* + [#89](https://github.com/metarhia/JSTP/pull/89) + * **lib:** make failed addon loading more informative + *(Alexey Orlenko)* + [#90](https://github.com/metarhia/JSTP/pull/90) + * **w3c-ws:** emit missing error event + *(Alexey Orlenko)* + [#93](https://github.com/metarhia/JSTP/pull/93) + * **w3c-ws:** fix invalid property access + *(Alexey Orlenko)* + [#94](https://github.com/metarhia/JSTP/pull/94) + * **test:** add Node.js 7.7 to .travis.yml + *(Alexey Orlenko)* + [#95](https://github.com/metarhia/JSTP/pull/95) + * **connection:** change style of a forward declaration + *(Alexey Orlenko)* + [#96](https://github.com/metarhia/JSTP/pull/96) + * **lib:** change multiline function signatures style + *(Alexey Orlenko)* + [#97](https://github.com/metarhia/JSTP/pull/97) + * **tools:** generate authors list automatically + *(Alexey Orlenko)* + [#88](https://github.com/metarhia/JSTP/pull/88) + * **meta:** update AUTHORS and .mailmap + *(Alexey Orlenko)* + [#88](https://github.com/metarhia/JSTP/pull/88) + * **meta:** fix misleading language in LICENSE + *(Alexey Orlenko)* + [#88](https://github.com/metarhia/JSTP/pull/88) + * **connection:** check that method arguments exist + *(Alexey Orlenko)* + [#100](https://github.com/metarhia/JSTP/pull/100) + ## Version 0.6.6 (2017-02-20, @aqrln) This is mostly a bugfix release. Additionally, parser performance is improved.