Skip to content

Commit

Permalink
Merge branch 'release/1.6.0'
Browse files Browse the repository at this point in the history
* release/1.6.0:
  Update the changelog for release 1.6.0
  Bump version to 1.6.0
  MLIBZ-652 Fix race condition in crypto localstorage adapter
  MLIBZ-667 Silence database errors during init
  MLIBZ-665 Public method to flush database cache
  MLIBZ-625 Use unminified version of loglevel
  MLIBZ-665 Cache WebSQL Data
  MLIBZ-665 Cache IndexedDB data
  MLIBZ-665 Run sync process in batches
  Use min files.
  Update promise-queue package
  Updates
  Handle hash in redirect uri for social connect
  Updates
  ITC test build
  more experimental performance changes for batched sync.
  batching sync operations
  Handle hash in redirect uri for social connect
  • Loading branch information
Thomas Conner committed Nov 7, 2015
2 parents 124e0e6 + beba74c commit 4048f11
Show file tree
Hide file tree
Showing 13 changed files with 424 additions and 210 deletions.
88 changes: 47 additions & 41 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,138 +1,144 @@
# Changelog
### 1.5.1 (2015-09-14)
* Bugfix: Check if `options.handler` is defined and is a function for network operations.
## Changelog
#### 1.6.0 (2015-11-06)
* Bugfix(MLIBZ-625): Fix third party library bug that prevented the library from being used in a Titanium environment.
* Bugfix(MLIBZ-652): Fix race condition in crypto localStorage adapter.
* Bugfix(MLIBZ-667): Fix methodUnsupported warning when using the SDK in a NodeJS environment.
* Enhancement(MLIBZ-665): Batch sync operations to prevent exhausting network resources. Cache database data in memory for faster retrievals. Don't send unnecessary network requests when syncing items created on the client.

### 1.5.0 (2015-09-04)
#### 1.5.1 (2015-09-14)
* Bugfix: Check if `options.handler` is defined and is a function for network operations.

#### 1.5.0 (2015-09-04)
* Enhancement(MLIBZ-498): Pending requests can be canceled by providing a `options.handler` that is called with a request object that contains a cancel function.
* Enhancement(MLIBZ-363): Replaced `console.log` statements in favor of [loglevel](https://github.com/pimterry/loglevel). Logs are now contained within log levels and can be persisted and turned on and off.
* Enhancement(MLIBZ-48): When an error occurs during a sync operation, the `_id` of the document that caused the error along with an error message is now returned.

### 1.4.5 (2015-08-14)
#### 1.4.5 (2015-08-14)
* Bugfix(MLIBZ-512): Fix bug in the `WebSqlAdapter` that caused the `system.sync` table to be incorrectly updated when mutiple offline items are added to the data store at the same time.

### 1.4.4 (2015-08-05)
#### 1.4.4 (2015-08-05)
* Bugfix(MLIBZ-493): Fix bug in `IDBAdapter` that would throw error when running two transactions at the same time.

### 1.4.3 (2015-07-16)
#### 1.4.3 (2015-07-16)
* Bugfix: Check if a table exists in SQLite before returning a generic error.

### 1.4.2 (2015-07-10)
#### 1.4.2 (2015-07-10)
* Bugfix: Correctly detect WebSql support for Windows Phone 8.1

### 1.4.1 (2015-06-25)
#### 1.4.1 (2015-06-25)
* Enhancement(MLIBZ-413): Added support for MIC API versioning.

### 1.4.0 (2015-06-25)
#### 1.4.0 (2015-06-25)
* Enhancement(MLIBZ-367): Added support to register a device for push notifications on Titanium.

### 1.3.6 (2015-06-09)
#### 1.3.6 (2015-06-09)
* Bugfix(MLIBZ-386): Added `isTemporaryObjectID` function to Titanium database adapter.
* Bugfix: Fixed typo where `IDBAdapter` was referencing `WebSqlAdapter`.

### 1.3.5 (2015-06-05)
#### 1.3.5 (2015-06-05)
* Bugfix(MLIBZ-317): Send a `POST` request when sync documents created while offline.
* Bugfix(MLIBZ-324): If an error occurs while open a database transaction, send the synchronous error back to the user using the error callback.
* Bugfix(MLIBZ-343): `OS_IOS` and `OS_ANDROID` are undefined on non Titanium alloy projects. Replaced to use `Titanium.Platform.name === 'iPhone OS'` and `Titanium.Platform.name === 'Android'` respectively.
* Bugfix(MLIBZ-341): Validate username and password when a user attempts to login. Don't send a network request if username and password are not valid.
* Bugfix(MLIBZ-349): Prevent logout from failing when an active user doesn't exist or and `Invalid Credentials` error is received from the Kinvey API.

### 1.3.4 (2015-05-20)
#### 1.3.4 (2015-05-20)
* BugFix(MLIBZ-337): Make `Kinvey.User.MIC.loginWithAuthorizationCodeLoginPage` work on the Titanium platform.
* BugFix: Handle database upgrade correctly on NodeJS platform.

### 1.3.3 (2015-05-18)
#### 1.3.3 (2015-05-18)
* Enhancement(MLIBZ-288): User friendly handling of 4xx/5xx responses.
* Enhancement(MLIBZ-307): Simple cache versioning.
* BugFix(MLIBZ-315): Default metadata to an empty object for backwards compatible syncing.
* BugFix(MLIBZ-323): Update build file to include IndexedDB adapter for PhoneGap build to Support Windows 8.

### 1.3.2 (2015-05-07)
#### 1.3.2 (2015-05-07)
* Enhancement(MLIBZ-266): Report library version and build in logs.
* BugFix(MLIBZ-284): Don't send an empty custom request properties header by default.

### 1.3.1 (2015-04-23)
#### 1.3.1 (2015-04-23)
* BugFix(MLIBZ-194): Returns a rejected promise rather then throwing an error when calling a function and expecting a promise to be returned.
* BugFix(MLIBZ-249): Fixed platform specific issues with MIC.

### 1.3.0 (2015-04-10)
#### 1.3.0 (2015-04-10)
* Enhancement(MLIBZ-213): Added support for Mobile Identity Connect
* BugFix(MLIBZ-207): Fixed bug that prevented a user from being logged out on Angular

## 1.2.1 (2015-03-30)
#### 1.2.1 (2015-03-30)
* BugFix(MLIBZ-208): Fixed bug that would throw incorrect `Content-Type` header errors for file requests.
* BugFix(MLIBZ-236): Fixed bug that would throw incorrect `Content-Type` header errors for requests with a 204 response status code.

## 1.2.0 (2015-03-25)
#### 1.2.0 (2015-03-25)
* Enhancement(MLIBZ-162): Added support for custom request properties.
* Enhancement(MLIBZ-188): Added support for client app version.

## 1.1.14 (2015-03-17)
#### 1.1.14 (2015-03-17)
* BugFix(MLIBZ-198): Fixed bug where all Angular requests would fail to due to headers object being null

## 1.1.13 (2015-03-16)
#### 1.1.13 (2015-03-16)
* Improved error messaging for data-driven exceptions

## 1.1.12 (2015-03-04)
#### 1.1.12 (2015-03-04)
* Deprecated: `Kinvey.API_ENDPOINT`
* Enhancement(MLIBZ-45): Replaced `Kinvey.API_ENDPOINT` with `Kinvey.APIHostName`. Set `Kinvey.APIHostName` with options in `Kinvey.init()`.

## 1.1.11 (2015-02-27)
#### 1.1.11 (2015-02-27)
* Enhancement: Using browser native XHR on Titanium mobile web. The response data type on the Titanium.Blob is now Blob, was UInt8Array.
* Bugfix(MLIBZ-53): Resolved memory leak in Titanium library on iOS when making an HTTP request.
* Bugfix(MLIBZ-56): Titanium library architecture error on iOS with TiPlatformConnect's jsOAuth require.
* Bugfix: Fixed bug where Titanium set Content-Type header on iOS GET requests that caused a GCS signature failure.

## 1.1.10 (2015-01-12)
#### 1.1.10 (2015-01-12)
* Enhancement: Added framework flag to Push for Phonegap so we can change how KCS handles the register/unregister methods.

## 1.1.9 (2014-12-05)
#### 1.1.9 (2014-12-05)
* Bugfix: Clone `options` argument when dealing with references to avoid interference.
* Bugfix: References support nested references within arrays

## 1.1.8 (2014-05-14)
#### 1.1.8 (2014-05-14)
* #2859: add `Kinvey.User.loginWithProvider` and `Kinvey.User.signupWithProvider` methods.
* #3223: use `angular.toJson` instead of `JSON.stringify` so properties starting with `$` are excluded.
* Bugfix: `maxAge` on query-level now overrides the document `maxAge`.
* Enhancement: Adjusted offline storage limit to 5MB as calculated by Safari.

## 1.1.7 (2014-03-05)
#### 1.1.7 (2014-03-05)
* #3165: add support for field selection.

## 1.1.6 (2014-02-11)
#### 1.1.6 (2014-02-11)
* Fixed bug where documents created offline did not sync.

## 1.1.5 (2014-01-29)
#### 1.1.5 (2014-01-29)
* #2985: add TTL support to caching & offline saving.
* #3062: offline sorting now supports sorting by nested properties.
* Enhancement: Updated promiscuous dependency.

## 1.1.4 (2014-01-07)
#### 1.1.4 (2014-01-07)
* #2847: remove support for case-insensitive and unanchored regexp.
* #2911: add Angular.js shim.
* Enhancement: Improved PhoneGap encryption methods.
* Enhancement: Updated promiscuous dependency.

## 1.1.3 (2013-12-02)
#### 1.1.3 (2013-12-02)
* #2765: Clear cache and state when user is locked down.
* #2768: Added PhoneGap encryption to credentials and offline storage.
* Bugfix: `force` flag of `Kinvey.User.logout` did not work with `Kinvey.Error.EMAIL_VERIFICATION_REQUIRED`.

## 1.1.2 (2013-10-08)
#### 1.1.2 (2013-10-08)
* #2464: Added PhoneGap Push support.
* Bugfix: `Kinvey.User.signup`, `login`, and `create` did not trigger error callback on `Kinvey.Error.ALREADY_LOGGED_IN` error.

## 1.1.1 (2013-09-20)
#### 1.1.1 (2013-09-20)
* Enhancement: Added Trigger.io device information.
* Enhancement: Locally generated document IDs now are strings of 24 hex characters.
* Bugfix: `Kinvey.Sync.count` would fail in offline mode.
* Bugfix: `options` were not passed when restoring the active user on `Kinvey.init`.
* Bugfix: Upgrading an offline database would cause deadlock in Internet Explorer 10.

## 1.1.0 (2013-08-29)
#### 1.1.0 (2013-08-29)
* #2602: Removed implicit users.
* Enhancement: Added `refresh` flag to `Kinvey.init` to control refreshing the active user data.

## 1.0.5 (2013-08-22)
#### 1.0.5 (2013-08-22)
* Enhancement: `Kinvey.User.login` now throws if given invalid arguments.
* Enhancement: TLS version (if available) is now forced on Titanium iOS.
* Bugfix: Headers were incorrectly set on Titanium iOS with debug mode enabled.
Expand All @@ -141,28 +147,28 @@
* Bugfix: Upon failure, social login for Titanium would throw a `TypeError`.
* Bugfix: Using files on Titanium Mobile Web failed due to GCS disallowing the X-Titanium-Id header.

## 1.0.4 (2013-07-25)
#### 1.0.4 (2013-07-25)
* Enhancement: Added compatibility with Google Closure Compiler.
* Enhancement: Querying for nearby locations now uses `$nearSphere` (was: `$near`).
* Bugfix: Android < 4 was not supported properly.
* Bugfix: Popup management for social login did not work in Firefox.

## 1.0.3 (2013-07-15)
#### 1.0.3 (2013-07-15)
* #2415: add RequestID to error object.
* #2467: replace IndexedDBShim by WebSQL adapter.
* Enhancement: `Kinvey.getActiveUser` now throws if the active user is not restored yet.
* Bugfix: Saving a user with references was not possible in offline mode.
* Bugfix: Setting the active user did not take concurrency into account.

## 1.0.2 (2013-07-10)
#### 1.0.2 (2013-07-10)
* Bugfix: IndexedDBShim was broken due to "use strict", downgraded version.
* Bugfix: Network requests on Titanium were instantiated incorrectly.

## 1.0.1 (2013-07-03)
#### 1.0.1 (2013-07-03)
* #2461: add PhoneGap shim.
* #2462: active user details not available in offline mode.

## 1.0.0 (2013-07-01)
#### 1.0.0 (2013-07-01)
* #2259: add Titanium shim.
* #2280: add RPC BL endpoints.
* #2414: active user is broken in offline mode.
Expand All @@ -173,5 +179,5 @@
* Bugfix: Error-handling using callbacks was broken because promises trap exceptions.
* Bugfix: `Kinvey.User.login` arguments were parsed incorrectly.

## 1.0.0-beta (2013-05-17)
#### 1.0.0-beta (2013-05-17)
* Initial beta release.
2 changes: 1 addition & 1 deletion config.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"node_modules/backbone-associations/backbone-associations-min.js"
],
"externals": [
"node_modules/loglevel/lib/loglevel.js",
"node_modules/loglevel/lib/loglevel.min.js",
"node_modules/promiscuous/dist/promiscuous-browser.js",
"node_modules/sift/sift.min.js",
"node_modules/promise-queue/lib/index.js"
Expand Down
2 changes: 1 addition & 1 deletion lib/jsdoc.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Kinvey JavaScript library (1.5.1, 2015-09-14)
## Kinvey JavaScript library (1.6.0, 2015-11-16)

### Welcome
Thanks for choosing Kinvey to build your backend. This is your complete guide to the Kinvey JavaScript library, available for HTML5, AngularJS, Backbone.js, Node.js, PhoneGap, and Titanium.
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "kinvey",
"version": "1.5.1",
"version": "1.6.0",
"description": "Kinvey JavaScript Library",
"homepage": "http://www.kinvey.com",
"bugs": {
Expand Down Expand Up @@ -28,7 +28,7 @@
"jquery-browser": "1.10.2-1",
"loglevel": "~1.4.0",
"promiscuous": "~0.6",
"promise-queue": "^2.1.1",
"promise-queue": "git+https://github.com/ThomasConner/promise-queue.git",
"sift": "~0.0",
"tiplatformconnect": "git://github.com/Kinvey/TiPlatformConnect.git",
"uglify-js": "~2.4",
Expand Down
2 changes: 1 addition & 1 deletion src/core/file.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ Kinvey.File = /** @lends Kinvey.File */{

// Build the flags.
var flags = {};
if(false !== options.tls) {
if(options.tls !== false) {
flags.tls = true;
}
if(options.ttl) {
Expand Down
10 changes: 10 additions & 0 deletions src/core/persistence/database.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ var Database = /** @lends Database */{
* @return {Promise} Upgrade has completed
*/
upgrade: function() {
var logLevel = Kinvey.Log.getLevel();
Kinvey.Log.disableAll();

try {
// Read the existing version of the database
return Database.find(Database.versionTable).then(null, function() {
Expand All @@ -55,9 +58,11 @@ var Database = /** @lends Database */{
// Save the version doc
return Database.save(Database.versionTable, doc);
}).then(function() {
Kinvey.Log.setLevel(logLevel);
return;
});
} catch (err) {
Kinvey.Log.setLevel(logLevel);
// Catch unsupported database methods error and
// just resolve
return Kinvey.Defer.resolve();
Expand Down Expand Up @@ -228,6 +233,11 @@ var Database = /** @lends Database */{
*/
isTemporaryObjectID: methodNotImplemented('Database.isTemporaryObjectID'),

/**
* Flush the cache
*/
flushCache: methodNotImplemented('Database.flushCache'),

/**
* Sets the implementation of `Database` to the specified adapter.
*
Expand Down
2 changes: 1 addition & 1 deletion src/core/persistence/net.js
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ Kinvey.Persistence.Net = /** @lends Kinvey.Persistence.Net */{
var customRequestPropertiesHeader = JSON.stringify(options.customRequestProperties);
var customRequestPropertiesByteCount = getByteCount(customRequestPropertiesHeader);
if (customRequestPropertiesByteCount >= CRP_MAX_BYTES) {
error = new Kinvey.Error('Custom request properties is ' + customRequestPropertiesByteCount +
error = new Kinvey.Error('Custom request properties are ' + customRequestPropertiesByteCount +
' bytes. It must be less then ' + CRP_MAX_BYTES + ' bytes.');
return wrapCallbacks(Kinvey.Defer.reject(error), options);
}
Expand Down
Loading

0 comments on commit 4048f11

Please sign in to comment.