Commits on Feb 25, 2012
  1. @snej

    Speculative fix for replication issue with dup attachments

    If a doc has two attachments with identical contents, TDMultipartDownloader will think there are fewer attachments than there really are (because it keys them by SHA-1 digest). This isn't a problem except for a sanity-check that was too strict. Loosened it up.
    snej committed Feb 24, 2012
Commits on Feb 22, 2012
  1. @snej

    Removed a bogus build setting in the Mac demo target

    It was just causing a harmless link warning.
    snej committed Feb 22, 2012
Commits on Feb 21, 2012
  1. @snej
  2. @snej

    Pull deleted revisions after live ones

    Optimization for pull replication: prioritize pulling non-deleted revisions. This doesn't make the total time shorter, but it makes visible stuff show up sooner, especially in a case like the first launch of GrocerySync, where there are a lot of older documents that have been deleted already.
    snej committed Feb 21, 2012
  3. @snej

    Overhauled checkpointing for pull replications

    Added TDSequenceMap to keep track of the latest sequence ID we can checkpoint.
    (Should be used for push replications too, but I haven't done that work yet.)
    snej committed Feb 21, 2012
  4. @snej

    Allow restart of a persistent replication

    Deleting the _replicator_state property of a replicator document starts a new replication.
    (This is also supported by CouchDB, but undocumented.)
    This makes persistent non-continuous replications more useful.
    snej committed Feb 20, 2012
  5. @snej

    Replication bug fixes

    * Persistent replications weren't restarting on app launch (oops).
    * Fix exception when persistent replication is deleted.
    * Wait longer (5sec) before saving checkpoint to remote server.
    snej committed Feb 21, 2012
Commits on Feb 20, 2012
  1. @snej
  2. @snej

    Get persistent replications working with REST API

    And updated Mac demo to use them.
    snej committed Feb 17, 2012
  3. @snej

    Persistent replications ('_replicator' database)

    Not really tested yet.
    snej committed Feb 16, 2012
  4. @snej

    Make replicator active/idle status accurate

    The 'active' property of TDReplicator wasn't being updated correctly. This in turn broke the status being reported in the _active_tasks REST API.
    snej committed Feb 20, 2012
  5. @snej

    Offline support

    TDReplicator detects when the remote host becomes reachable/unreachable, usually as a result of the device going on/offline. Replication is stopped when offline and restarted when back online.
    snej committed Feb 14, 2012
  6. @snej
Commits on Feb 18, 2012
  1. @snej

    Fixed missing response for some failing REST requests

    Nasty bug fixed: TDRouter would react to some errors (like a request to a nonexistent database, or an invalid document ID) without returning an HTTP response, so the caller's request would fall on the floor and eventually time out.
    
    Also improved the TDRouter unit tests to catch this type of problem.
    snej committed Feb 17, 2012
Commits on Feb 17, 2012
  1. @snej

    Fix a crash with replication after closing a database

    TDDatabase wasn't unregistering itself from replication notifications in its -dealloc method, so after a database has been dealloced any notification from any replication would likely cause an exception or crash.
    snej committed Feb 16, 2012
Commits on Feb 15, 2012
  1. @snej
  2. @snej

    Oops, fix crash in the new retry code

    It shouldn't be clearing _request, just _connection.
    snej committed Feb 15, 2012
  3. @snej
  4. @snej

    Work around OS bug in NSJSONSerialization

    Fixes issue #44.
    snej committed Feb 14, 2012
Commits on Feb 13, 2012
  1. @snej

    Oops, hadn't updated MYUtilities submodule to correspond to a new com…

    …mit in that repo
    
    Fixes #43.
    snej committed Feb 13, 2012
Commits on Feb 12, 2012
  1. @snej

    Make filters work for push replications

    TDPusher already had a 'filter' property but it wasn't being set by TDRouter.
    While I was at it, I refactored the 'filterName' and 'filterParameters' properties from TDPuller up to TDReplicator, so TDPusher can use them too.
    snej committed Feb 12, 2012
Commits on Feb 11, 2012
  1. @snej

    TDRouter honors ?atts_since in document GET requests

    An optimization to avoid sending unnecessary attachments that the caller already knows about, while being passively pulled from.
    
    Also some small refactoring:
    * Moved +parseRevID: from TDDatabase to the more-appropriate TDRevision.
    * Created +[TDDatabase stubOutAttachmentsIn:beforeRevPos:] from some former static functions in TDPusher.
    snej committed Feb 10, 2012
Commits on Feb 10, 2012
  1. @snej

    Better handling of "possible_ancestors" in replication

    * Implementation of _revs_diff API now returns the possible_ancestors arrays.
    * Pull replication sends better list of revs in "atts_since" key.
    snej committed Feb 10, 2012
  2. @snej

    iOS on-device fixes

    * Fixed iOS demo target settings so it'll run on a device without getting entitlements errors.
    * Fixed paths to temp files generated by unit tests since /tmp isn't accessible on a real iOS device.
    snej committed Feb 9, 2012
  3. @snej

    Added Apache license comments.

    (No code changes.)
    snej committed Feb 9, 2012
  4. @snej

    Added test TDPuller_FromCouchApp

    This is for testing issue #39. I can't reproduce it myself.
    snej committed Feb 9, 2012
  5. @snej

    Create fewer temp directories during attachment download

    Was creating a new temp dir per attachment; now just creates one per database. Still not sure why these dirs are being left behind, but I've asked about it on cocoa-dev.
    snej committed Feb 9, 2012
  6. @snej

    Fix some compile errors

    - Some implicit 64-to-32-bit conversions in the 64-bit build
    - Missing call to [super dealloc], reported by newer version of Clang compiler.
    snej committed Feb 9, 2012
  7. @snej

    Allow GET of attachment whose name contains "/"s

    ...without having to escape the '/' characters, that is.
    This fixes #40.
    snej committed Feb 9, 2012
Commits on Feb 9, 2012
  1. @snej

    Merge pull request #38 from fcandalija/master

    I think this fixes #37.
    snej committed Feb 9, 2012
Commits on Feb 7, 2012
  1. @snej

    Fixed winning-revision rule for conflicts

    If there are conflicting revisions the one with the greater revid "wins" and is returned by default.
    The problem is that CouchDB has a specific definition of "greater" for revIDs -- basically, the numeric prefix is parsed as a number, not as ASCII. This only makes a difference for revisions with generation numbers greater than 9.
    For compatibility, I've added a custom collation for rebids that matches CouchDB. This fixes #10.
    snej committed Feb 7, 2012
  2. @snej

    Make TDPusher only upload attachments that have changed.

    FIxes #36.
    snej committed Feb 7, 2012
Commits on Feb 6, 2012
  1. @snej

    Bump version, fix unit-test issue in iOS Demo app

    * Changed version to 0.5.
    * Unit tests were broken in the iOS Demo app because Test_BlobStore.m needed to be added to the app target itself.
    snej committed Feb 6, 2012
  2. @snej

    Fixed the URL of the MYUtilities submodule.

    If you have an existing checkout of TouchDB, you may have to change the value of the [submodule "vendor/MYUtilities"] config property, e.g. by editing .git/config, for this change to take effect.
    snej committed Feb 6, 2012