substr is depreciated I believe but `row.value.rev.slice(0,2) !== '1-'`
would probably be good


On Wed, Mar 26, 2014 at 9:53 AM, Jean-Felix <notifications@github.com>wrote:

> In lib/replicate.js:
>
> > +  function fetchGenerationOneRevs(ids, revs) {
> > +    src.allDocs({keys: ids, include_docs: true}, function (err, res) {
> > +      if (promise.cancelled) {
> > +        return replicationComplete();
> > +      }
> > +      if (err) {
> > +        return abortReplication('src.get completed with error', err);
> > +      }
> > +
> > +      res.rows.forEach(function (row, i) {
> > +        // fetch document again via api.get when doc
> > +        // * is deleted document (could have data)
> > +        // * is no longer generation 1
> > +        // * has attachments
> > +        var needsSingleFetch = !row.doc ||
> > +          parseInt(row.value.rev, 10) > 1 ||
>
> Would it be safer to use row.value.rev.substr(0,2) !== '1-' ?
>
> --
> Reply to this email directly or view it on GitHub<https://github.com/daleharvey/pouchdb/pull/1732/files#r10976593>
> .
>



-- 
-Calvin W. Metcalf