marten-de-vries / pouchdb-seamless-auth Goto Github PK
View Code? Open in Web Editor NEWSeamless switching between online (CouchDB) and offline (PouchDB) authentication.
Seamless switching between online (CouchDB) and offline (PouchDB) authentication.
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)) {
Currently the Travis build fails, while it works offline. See: https://travis-ci.org/marten-de-vries/pouchdb-seamless-auth/jobs/102394556
For untrusted computers, that works only with the online db. Pretty much the idea described in the warning.
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:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.