Skip to content
Commits on May 17, 2016
  1. @snej

    Made CBLRemoteRequest JSON error detection work with CouchDB-type server

    Fixes a minor bug in 6f3c6fc -- the workaround for CouchDB not returning
    JSON as application/json didn't have the right string constant to
    detect the "text/plain" type it returns.
    
    For #1245
    snej committed May 16, 2016
Commits on May 16, 2016
  1. @snej

    Be more careful with attachment lengths, & other improvements

    Attempting to resolve the attachment length mismatch reported in #1207.
    Still haven't found the cause, but made sure the pusher and listener
    set the Content-Length to the actual data length, not the value from the
    "length" property which might be inaccurate. Also added a warning when
    the two lengths disagree.
    
    Also some cleanup in CBLAttachment, like better checking of the body
    object on creation.
    
    For #1207
    snej committed May 16, 2016
  2. @pasin

    Merge pull request #1246 from couchbase/fix/better_server_errors_1245

    CBLRemoteRequest reads error from JSON body when it gets a 4xx/5xx status
    pasin committed May 16, 2016
Commits on May 13, 2016
  1. @snej

    CBLRemoteRequest reads error from JSON body when it gets a 4xx/5xx st…

    …atus
    
    - Moved the JSON buffer from CBLRemoteJSONRequest up to CBLRemoteRequest.
    - Took the status code out of the error message created by
      CBLStatusToNSErrorWithInfo.
    - Removed the createTarget setting from the replications run by
      ReplicatorInternal_Tests; it's not supported by SG so it just causes
      spurious 412 errors.
    
    Fixes #1245
    snej committed May 13, 2016
  2. @snej

    Merge branch 'master' into dev

    snej committed May 13, 2016
Commits on May 11, 2016
  1. @snej
Commits on May 10, 2016
  1. @snej

    SQLite: Don't insert unnecessary revisions in -forceInsert:

    Instead of inserting every single revision in the history (and then
    possibly pruning most of them later), find the common ancestor and
    just insert the ones newer than it. If there's no common ancestor,
    only insert maxRevTreeDepth revisions, as any more will just be
    pruned.
    snej committed May 9, 2016
  2. @snej

    Reduce number of revs sent with GET and _bulk_get requests

    The pull replicator sends more local revIDs than it needs to, as
    context when requesting documents. This wastes bandwidth.
    
    Also, it only sends these when the doc has attachments (the atts_since
    parameter.) It should send them always, so SG can intelligently prune
    the history it sends in the response. If there are no attachments it
    will use a newly-defined 'revs_from' parameter for these instead.
    
    Finally, if there are no known ancestors to send, it now sends a
    newly-defined 'revs_limit' parameter whose value is the db's maximum
    rev tree depth, to tell the server the max history size to send.
    
    Fixes #1242
    snej committed May 9, 2016
Commits on May 6, 2016
  1. @pasin

    Backout source_files setting for osx podspec

    For some reason, setting source_files to the OSX couldn't pass cocoapod linting. I backed out this change and we could explore this more if somebody has an issue without setting the source file for the OSX.
    
    #1205
    pasin committed May 6, 2016
  2. @pasin

    Merge pull request #1229 from couchbase/fix/push_empty_1228

    Fixed: One-shot push from empty database never stops
    pasin committed May 6, 2016
Commits on May 5, 2016
  1. @snej

    Merge pull request #1237 from couchbase/fix/endless_merge_1217

    More accurate rev pruning in SQLite storage (fixes endless-merge bug)
    snej committed May 5, 2016
  2. @snej

    Optimization for SQLite -getPossibleAncestorRevisionIDs:

    Can just test the no_attachments flag in the SQL query instead of
    doing a SELECT on every rev afterwards to read the flag.
    snej committed May 5, 2016
  3. @snej
  4. @snej

    Updated old workaround in SQLiteStorage to work with the real fix

    If a revision being PUT turns out to be a duplicate, we should fix the
    parent link of the pre-existing row, because it was probably nulled out
    when its previous parent got pruned.
    
    The situation is like this: we used to have
       1 <-- 2/
    Where 2 is a deletion. Then rev 1 got pruned because the old pruning
    algorithm was sloppy and just deleted all non-current revs below a
    certain generation count:
             2/
    Then 1 got pulled by the replicator because the server is behind and
    still has that rev:
       1     2/
    Note that there's no link from 2 to 1 now! Instead 1 is current, so it's
    a false conflict. Now the app decides to resolve the conflict by
    deleting 1. But this creates a revision identical to 2, so SQLite won't
    add it. In this situation we used to clear 1's current flag; but that
    just makes 1 go away during the pruning, putting us back in the same
    state as before. We also need to fix the parent link from 2 to point to
    1:
       1 <-- 2/
    Now 1 is part of a branch and won't be pruned, but the branch is
    deleted so the conflict is gone.
    
    Fixes #1217
    snej committed May 5, 2016
  5. @snej

    More accurate rev pruning in SQLite storage (fixes endless-merge bug)

    The quick-and-dirty pruning algorithm for SQLite wasn't good enough. It
    would get rid of all non-leaf revisions of a branch, if there was a
    much deeper branch as well. This could cause the parent of the short
    branch's leaf to be added again if pulled by the replicator, which
    effectively re-creates the conflict if the short branch ended in a
    deletion.
    
    The code now does the Right Thing by traversing the rev tree and
    preserving all revisions that are within maxRevTreeDepth generations of
    a leaf.
    
    Unfortunately this is going to slow down insertions somewhat. It could
    be optimized because there are some redundant fetches of revs being
    done, but honestly I'd rather save the effort for ForestDB.
    
    Fixes #1217
    snej committed May 4, 2016
  6. @snej
Commits on May 4, 2016
  1. @snej
  2. @snej
Commits on Apr 27, 2016
  1. @snej

    Fixed: One-shot push from empty database never stops

    Weird edge case: the replicator never becomes active, so it didn't
    realize it should stop when it didn't find any work to do.
    
    Fixes #1228
    snej committed Apr 27, 2016
Commits on Apr 26, 2016
  1. @snej

    Fixed crashing regression from CBL_RevID refactoring

    An array of NSStrings was being passed to a method that expected an
    array of CBL_RevIDs.
    Added a utility to assert that an array contains revIDs.
    
    Fixes #1224
    snej committed Apr 26, 2016
Commits on Apr 25, 2016
  1. @snej

    Merge branch 'master' into dev

    snej committed Apr 25, 2016
  2. @snej

    Fixed CBL iOS Framework build

    * Target had no source files, which causes Xcode build to fail (it
      doesn't link the binary together), so I added noop.m.
    * Now needs to link with libstdc++ because CBL has a couple of C++
      source files.
    snej committed Apr 25, 2016
  3. @snej

    Fixed archive build of LiteServ.app

    snej committed Apr 25, 2016
  4. @snej

    Fixed archive build of Listener

    (Regression, from factoring out part of CBLView into the listener)
    snej committed Apr 25, 2016
  5. @snej

    Fixed missing symbol _CBLRegisterJSViewCompiler in archive build

    (This is a subset of commit 4bc9e33 from the deb branch)
    snej committed Apr 25, 2016
  6. @snej

    Fixed framework .exp files

    * CBLRegisterJSViewCompiler is in the listener now
    * CBLCompareRevIDs no longer exists
    
    Fixes #1221
    snej committed Apr 25, 2016
  7. @snej
  8. @snej

    Merge branch 'feature/multipart-buffer' of https://github.com/robertj…

    …payne/couchbase-lite-ios into robertjpayne-feature/multipart-buffer
    snej committed Apr 25, 2016
  9. @snej

    ForestDB optimizations

    Avoid loading document bodies unless necessary.
    snej committed Apr 25, 2016
  10. @snej

    Minor change to adapt to C4 API change

    Need to call new c4db_free and c4view_free functions.
    Also added C4 leak detection to CBLTestCase.
    snej committed Apr 21, 2016
  11. @snej
Commits on Apr 17, 2016
  1. @snej

    Made CBLChangeTracker docIDs filter compatible with CouchDB

    CouchDB still requires the filter= parameter in the URL.
    Also added a ChangeTracker unit test for docIDs, and found two Sync
    Gateway bugs using it :(
    
    For #1139
    snej committed Apr 16, 2016
Commits on Apr 15, 2016
  1. @pasin

    Merge pull request #1211 from couchbase/fix/revpos_zero_1200

    Allow incoming attachments with revpos:0, for PouchDB compatibility
    pasin committed Apr 14, 2016
  2. @snej

    Fixed crashing bug in MYLogging

    Recent regression from the rewrite of the MYUtilities logging code.
    Fixes #1214
    snej committed Apr 14, 2016
Commits on Apr 14, 2016
  1. @pasin

    Merge pull request #1212 from couchbase/fix/websocket_gzip_1074

    Partially fixed CBLWebSocketChangeTracker unzip errors
    pasin committed Apr 14, 2016
Something went wrong with that request. Please try again.