Giter Site home page Giter Site logo

pouchdb-seamless-auth's People

Contributors

greenkeeperio-bot avatar linus avatar marten-de-vries avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

pouchdb-seamless-auth's Issues

Problem with 'replication'

I'm struggling with a couple of issues that aren't working as I expected and so dug into the code a little and noticed a line that will eventually fail at around line 166 & 168 in startReplication.

There is a check to see if replication is needed in a specific direction e.g.
if (remoteDoc._rev > localDoc._rev) {
When a document revision goes from 9-xxxxxxxx to 10-xxxxxxx the checks will give the opposite of what is expected.

It needs a function to extract the revision value and to use that in the compares e.g.

function getRev(doc){
    return parseInt(doc._rev.split('-')[0]);
}
...
if (getRev(remoteDoc) > getRev(localDoc)) {

Add fallback mode

For untrusted computers, that works only with the online db. Pretty much the idea described in the warning.

Sounds good...but I don't understand

This sounds great... I just don't understand how to use it! I've looked at the tests and I still don't get it. I'm not really clear on when I use the functions in this library vs the ones in pouchdb-auth. Could you provide some examples?

Here is the sort of use case I am after:

  • My user exists on the remote couchdb. I login to my web application, but there is no matching user in the browser's local database, so it checks the remote couchdb, finds the user, and caches it so that next time checking the remote couchdb isn't necessary.
  • My user doesn't exist locally or on the remote couchdb. So I create a new one, it gets created on the remote couchdb and on the local one so that next time checking the remote couchdb isn't necessary

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.