iOS
In this document
1.0.3.1, October 28, 2014
This is to fix two regressions introduced in 1.0.3, one a crash and one a hang:
#438 has a workaround, but #500 doesn't; it will just cause random deadlocks. (Apparently the app needs to do specific things to hit the situation that deadlocks, but it's not clear what those things are or how to avoid them.)
1.0.3, October 17, 2014
With our third quality release we again focus on bug fixing and improvements, but have begun to add enhancements that we plan to port over to the rest of the Couchbase Lite clients in our next major release. Some highlights are as follows:
Features
- Added several CBLQuery enhancements to allow custom sorting and filtering, and to make prefix-match queries easier to write.
- Added method
-[CBLDatabase close]to explicitly close a database. This can be useful for apps that manage a large number of databases and want to limit the number of open files. - CBLModel now supports the NSURL class for document properties.
- CBLModel now has a "type" property, to make it easier to set the "type" property of a document.
Bug fixes
- Self-signed server certs, that were properly registered with the replicator, are no longer improperly rejected.
- Models are autosaved on the correct thread.
- Grouped queries now properly reduce the values from the final group of rows.
- CBLLiveQuery will now refresh after the view's mapBlock is changed.
- Fixed a bug that caused
-deleteDatabase:to sometimes hang. - SSL connections now require the TLS v1 protocol, to avoid falling back to SSLv3 which is potentially vulnerable to the "POODLE" exploit (even though that exploit seems to require a web browser, not an app using a REST API.)
Improvements
- Better arbitration between multiple threads wanting to access a database. This should eliminate "database busy" warnings or errors and many of the delays caused by waiting for the database.
- Faster allDocuments queries.
- Faster database compaction.
- In the static library, symbols from 3rd party libraries (like CocoaLumberjack and GCDAsyncSocket) are now renamed, to avoid causing conflicts in apps that also use those libraries.
1.0.2, August 22, 2014
In our second quality release, we have added optimizations and fixes for map/reduce, fixes to our SSL support and Replication API, behavior corrections in CBLModel, addressed a number of issues filed on the changes feed, added a few iOS-specific APIs, and more. Let's go through some of these changes as follows:
Map/Reduce optimizations
Optimize view performance by re-indexing multiple views together: When updating a view's index, Couchbase Lite now also updates other related views' indexes simultaneously. This saves time because a lot of the work (iterating through the sequences, fetching the documents, looking for conflicts) is shared. The other views that will get updated are the ones whose names share the same prefix up through the first "/". (This is the same rule used by CouchDB.) If the view's name does not include a "/", it won't be indexed with any other views. To take advantage of this, you should name your views so that views that are often used together — like in the same screen of your UI — share a common prefix. (For instance, "tasklist/bydate", "tasklist/commentcount") (Commit 09b9a75)
Optimization for map functions that emit 'doc' as the value: It's still better for performance to not emit the entire document as a value, but there are some apps that do it because they're following old/obsolete advice or sample code, so we've optimized it to reduce the slowdown. (Commit 03454e8)
Several other view-indexing performance optimizations. (Commits 59594d4, ce3ea09)
Fixes for SSL server cert trust checking
- CBLSocketChangeTracker now allows a self-signed cert, provided the replicator allows it (i.e. app has configured that root cert.)
- The replicator now stops completely on an SSL trust error instead of retrying.
- Replicator now sets the correct error code when it comes across an untrusted server cert. (Invalid-cert, not auth-canceled.) (Commit d222ba1)
Replicator fixes
- Fixes for "_asyncTaskCount >= 0" assertion failures
- Fixes for checkpoints not being saved or for 409 Conflict errors saving checkpoints
API additions
We have also made some iOS-specific API additions that include the following:
-
CBLJSON.h:
+ (NSString*) JSONObjectWithDate: (NSDate*)date timeZone:(NSTimeZone *)tz; -
CBLManager.h:
//Added to struct CBLManagerOptions: NSDataWritingOptions fileProtection; /**< File protection/encryption options (iOS only) */ /** Should the databases and attachments be excluded from iCloud or Time Machine backup? Defaults to NO. */ @property BOOL excludedFromBackup; /** Redirects Couchbase Lite logging: instead of writing to the console/stderr, it will call the given block. Passing a nil block restores the default behavior. */ + (void) redirectLogging: (void (^)(NSString* type, NSString* message))callback; -
CBLReplication.h:
/** Suspends/resumes a replication. On iOS a replication will suspend itself when the app goes into the background, and resume when the app is re-activated. If your app receives a push notification while suspended and needs to run the replication to download new data, your handler should set suspended to NO to resume replication, and then set the property back to YES when it's done. */ @property BOOL suspended;
Some additional fixes we'd like to highlight include:
- Fixes to CBLModel #310, #363
- Corrupt response to Content-Range requests if already in client's cache #317
- App being rejected due to iCloud backup #357
- WebSocket change tracker doesn't work with CBLAuthenticator #400
- CBLSocketChangeTracker/CBLJSONReader SIGSEGV crashes #369
- _changes JSON response from Sync Server fails parsing #384
- Infinite loop on CBLDocument update #349
- The draconian thread-safety check is not sufficient to detect compatible queues #376
- CBLQuery doesn't call observer on dispatch queue #364
- Failing assertion in CBLQueryRow due to unset _database #403
1.0.1, July 22, 2014
This is our first patch release for 1.0.0, that features fixes for higher impact issues in our Document, change tracker, and map/reduce APIs.
- Fixed a bug in
-[CBLDocument update:error:]that could cause an infinite loop if the update was blocked by a conflicting update. #349 - Hide any passwords in URLs logged by
CBLSocketChangeTracker - Fixed some mistakes in documentation-comments in CBLQuery.h #342, #343
- Make
[-CBLQueryRow description]not crash if the row's value is nil #318 CBLQuerynow calls its observer on the correct dispatch queue #364- Database-change notifications are now delivered correctly when using dispatch queues #364
1.0.0, May 21, 2014
This is our first official release for Couchbase Lite. A major change from our Beta releases and 1.0.0 is an expansion of our platform support, which includes a 1.0.0 ready version of "portable" Java libraries to support Linux-based app development. We've also made a lot of advancement in the performance stability of our Android and Java platform, created better parity for our authentication support, and enabled better logging for community debugging feedback. Simultaneously to this release, we have also published our first beta for our C# support in a collaborative effort with our partner, Xamarin.
As we continue to build out our platform, we have made some API naming changes to reflect a strengthened spec that supports us across many different spaces. Between our last Beta and 1.0.0, we've made some minor adjustments to our naming conventions regarding basic authentication, cookie-based authentication, and logging support.