Skip to content

Commit

Permalink
Merge pull request #577 from XiaoningLiu/2.10.3
Browse files Browse the repository at this point in the history
2.10.3
  • Loading branch information
vinjiang authored Apr 16, 2019
2 parents 0557d02 + 0d5c534 commit 1e31548
Show file tree
Hide file tree
Showing 12 changed files with 6,938 additions and 66 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
language: node_js
node_js:
- "4"
- "5"
- "6"
- "7"
- "8"
- "10"
- "11"

after_script:
- npm run coveralls
Expand Down
9 changes: 9 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
Note: This is an Azure Storage only package. The all up Azure node sdk still has the old storage bits in there. In a future release, those storage bits will be removed and an npm dependency to this storage node sdk will
be taken. This is a GA release and the changes described below indicate the changes from the Azure node SDK 0.9.8 available here - https://github.com/Azure/azure-sdk-for-node.

2019.04 Version 2.10.3

* Fixed callback not being called in _getBlobToLocalFile.
* Removed retryInfo.retryable check in retrypolicyfilter.js.
* Removed comment about maxResults.
* Fixed Travis-CI failed validation.
* Updated latest links and descriptions to V10 SDK in readme.md.
* Fixed some errors are thrown in a inner async callback which cannot be caught.

2018.10 Version 2.10.2

ALL
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@

This project provides a Node.js package and a browser compatible [JavaScript Client Library](https://github.com/Azure/azure-storage-node#azure-storage-javascript-client-library-for-browsers) that makes it easy to consume and manage Microsoft Azure Storage Services.

> This README page is a reference to the SDK v2. For the new SDK v10, go to [Storage SDK v10 for JavaScript (Preview)](https://github.com/Azure/azure-storage-js).
> This README page is a reference to the SDK v2. For the new SDK v10, go to [Storage SDK v10 for JavaScript](https://github.com/Azure/azure-storage-js).
| SDK Name | Version | Description | NPM/API Reference Links |
|------------------------------------------------------------------------------------------|-------------|------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Storage SDK v10 for JavaScript](https://github.com/Azure/azure-storage-js) | v10-Preview | The next generation async Storage SDK (Blob only, async and promise support) | [NPM](https://www.npmjs.com/package/@azure/storage-blob) - [Reference](https://docs.microsoft.com/en-us/javascript/api/%40azure/storage-blob/index?view=azure-node-preview) |
| [Storage SDK v10 for JavaScript](https://github.com/Azure/azure-storage-js) | v10 | The next generation Storage SDK (Blob/Queue/File, async and promise support) | [NPM](https://www.npmjs.com/package/@azure/storage-blob) - [Reference](https://docs.microsoft.com/en-us/javascript/api/overview/azure/storage/client?view=azure-node-preview) |
| [Storage SDK v2 for JavaScript](https://github.com/Azure/azure-storage-node) | v2 | Legacy Storage SDK in this repository (Blob/Queue/File/Table, callback style) | [NPM](https://www.npmjs.com/package/azure-storage) - [Reference](https://docs.microsoft.com/en-us/javascript/api/azure-storage/?view=azure-node-latest) |
| [Azure Management SDKs for JavaScript](https://github.com/Azure/azure-sdk-for-node) | v2 | Management SDKs including Storage Resource Provider APIs | [NPM](https://www.npmjs.com/package/azure) - [Reference](https://github.com/Azure/azure-sdk-for-node#documentation) |

Expand Down
9 changes: 9 additions & 0 deletions browser/ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
Note: This is the change log file for Azure Storage JavaScript Client Library.

2019.04 Version 2.10.103

* Generated browser compatible JavaScript files based on Microsoft Azure Storage SDK for Node.js 2.10.3.
* Fixed callback not being called in _getBlobToLocalFile.
* Removed retryInfo.retryable check in retrypolicyfilter.js.
* Removed comment about maxResults.
* Fixed Travis-CI failed validation.
* Updated latest links and descriptions to V10 SDK in readme.md.

2018.10 Version 2.10.102

ALL
Expand Down
39 changes: 2 additions & 37 deletions gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,6 @@ module.exports = function(grunt) {
//init stuff
grunt.initConfig({

nsp: {
package: grunt.file.readJSON('package.json')
},

mochaTest: {
test: {
options: {
reporter: 'spec',
quiet: false,
clearRequireCache: false,
timeout: 100000
},
src: ['test/**/*.js']
}
},

//jsdoc config
jsdoc: {
dist: {
Expand Down Expand Up @@ -78,29 +62,10 @@ module.exports = function(grunt) {
}
},

// devserver config
devserver: {
server : {},
options: {
'base': 'docs'
}
},

jshint: {
all: ['Gruntfile.js', 'lib/**/*.js'],
options: {
jshintrc: true
}
}
});

grunt.loadNpmTasks('grunt-jsdoc');
grunt.loadNpmTasks('grunt-mocha-test');
grunt.loadNpmTasks('grunt-devserver');
grunt.loadNpmTasks('grunt-nsp');
grunt.loadNpmTasks('grunt-contrib-jshint');

grunt.registerTask('doc', ['jsdoc', 'devserver']);
grunt.registerTask('validate', ['jshint', 'nsp']);
grunt.registerTask('default', ['validate', 'mochaTest']);
grunt.registerTask('doc', ['jsdoc']);
grunt.registerTask('default', ['doc',]);
};
2 changes: 1 addition & 1 deletion lib/common/filters/retrypolicyfilter.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ RetryPolicyFilter._shouldRetryOnError = function (statusCode, requestOptions) {
} else {
retryInfo.retryable = false;
}
} else if (retryInfo.retryable && statusCode >= 500 && statusCode < 600) {
} else if (statusCode >= 500 && statusCode < 600) {
// Retry on the server error
retryInfo.retryable = true;
retryInfo.lastServerError = true;
Expand Down
2 changes: 1 addition & 1 deletion lib/common/util/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ var Constants = {
* @const
* @type {string}
*/
USER_AGENT_PRODUCT_VERSION: '2.10.2',
USER_AGENT_PRODUCT_VERSION: '2.10.3',

/**
* The number of default concurrent requests for parallel operation.
Expand Down
4 changes: 2 additions & 2 deletions lib/services/blob/blobservice.core.js
Original file line number Diff line number Diff line change
Expand Up @@ -1132,7 +1132,7 @@ BlobService.prototype.listBlobDirectoriesSegmentedWithPrefix = function (contain
* @param {object} currentToken A continuation token returned by a previous listing operation. Please use 'null' or 'undefined' if this is the first operation.
* @param {object} [options] The request options.
* @param {string} [options.delimiter] Delimiter, i.e. '/', for specifying folder hierarchy.
* @param {int} [options.maxResults] Specifies the maximum number of blobs to return per call to Azure ServiceClient. This does NOT affect list size returned by this function. (maximum: 5000)
* @param {int} [options.maxResults] Specifies the maximum number of blobs to return per call to Azure ServiceClient. (maximum: 5000)
* @param {string} [options.include] Specifies that the response should include one or more of the following subsets: '', 'metadata', 'snapshots', 'uncommittedblobs', 'copy', 'deleted').
* Please find these values in BlobUtilities.BlobListingDetails. Multiple values can be added separated with a comma (,).
* **Note** that all metadata names returned from the server will be converted to lower case by NodeJS itself as metadata is set via HTTP headers and HTTP header names are case insensitive.
Expand Down Expand Up @@ -1164,7 +1164,7 @@ BlobService.prototype.listBlobsSegmented = function (container, currentToken, op
* @param {object} currentToken A continuation token returned by a previous listing operation. Please use 'null' or 'undefined' if this is the first operation.
* @param {object} [options] The request options.
* @param {string} [options.delimiter] Delimiter, i.e. '/', for specifying folder hierarchy.
* @param {int} [options.maxResults] Specifies the maximum number of blobs to return per call to Azure ServiceClient. This does NOT affect list size returned by this function. (maximum: 5000)
* @param {int} [options.maxResults] Specifies the maximum number of blobs to return per call to Azure ServiceClient. (maximum: 5000)
* @param {string} [options.include] Specifies that the response should include one or more of the following subsets: '', 'metadata', 'snapshots', 'uncommittedblobs', 'copy', 'deleted').
* Please find these values in BlobUtilities.BlobListingDetails. Multiple values can be added separated with a comma (,).
* **Note** that all metadata names returned from the server will be converted to lower case by NodeJS itself as metadata is set via HTTP headers and HTTP header names are case insensitive.
Expand Down
22 changes: 18 additions & 4 deletions lib/services/blob/blobservice.node.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,12 @@ BlobService.prototype.appendFromLocalFile = function (container, blob, localFile
}
callback(appendError, blob, response);
};
self._uploadBlobFromStream(false, container, blob, BlobConstants.BlobTypes.APPEND, stream, stat.size, options, streamCallback);

try {
self._uploadBlobFromStream(false, container, blob, BlobConstants.BlobTypes.APPEND, stream, stat.size, options, streamCallback);
} catch (err) {
callback(err);
}
}
});

Expand Down Expand Up @@ -388,7 +393,11 @@ BlobService.prototype._createBlobFromLocalFile = function (container, blob, blob
callback(error);
} else {
size = stat.size;
self._createBlob(container, blob, blobType, size, options, creationCallback);
try {
self._createBlob(container, blob, blobType, size, options, creationCallback);
} catch (err) {
callback(err);
}
}
});

Expand Down Expand Up @@ -443,13 +452,18 @@ BlobService.prototype._getBlobToLocalFile = function (container, blob, localFile

this.getBlobToStream(container, blob, writeStream, options, function (error, responseBlob, response) {
if (error) {
writeStream.end(function () {
var onErrorCallback = function() {
// If the download failed from the beginning, remove the file.
if (fs.existsSync(localFileName) && writeStream.bytesWritten === 0) {
fs.unlinkSync(localFileName);
}
callback(error, responseBlob, response);
});
};
if (!writeStream.closed) {
writeStream.end(onErrorCallback);
} else {
onErrorCallback();
}
} else {
callback(error, responseBlob, response);
}
Expand Down
Loading

0 comments on commit 1e31548

Please sign in to comment.