Database#replicate is sending an empty doc_ids when it is not specified #67

Open
wants to merge 1 commit into
from

Projects

None yet

3 participants

@asterite

def replicate(other_db, continuous, options)
...
# Here you are copying the options, so you have payload[:doc_ids]
payload = options
...
# And if options[:doc_ids] is nil, payload still has the :doc_ids set to nil... it should be removed...
payload['doc_ids'] = options[:doc_ids] if options[:doc_ids]

So I changed that line to:

  payload.delete :doc_ids unless options[:doc_ids]

(well, you can see it in the diff, but the explanation is worth it :-P)

Sorry, I don't know how to spec it (or why your current spec passes)

@samlown
CouchRest member

Hi. I'm afraid your fix does not really get to the root of the problem. There is a whole lot of crappy code around replication that I haven't had chance to refactor yet. I'll try and fix this soon.
Cheers, sam

@PokerChang

Strongly request the pull before refactor. I got hit by this bug and wasted many hours.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment