change direction = push in both client

16 views
Skip to first unread message

Jeremy Vuillermet

unread,
Nov 13, 2015, 4:42:40 AM11/13/15
to PouchDB
Hello,

My setup is the following. One local db live synced with a remote one.

db.sync(remote, {
      live: true,
      retry: true
    }).on('change', (data) => {
      console.log('change', data)
 }

I open 2 tabs of my app. When I create a new doc. both the client receive a change update with a 'push' direction.

Is this normal ?

I would like to know when there is a change from the remote so I can notify the rest of my app and send the new docs.

Jeremy Vuillermet

unread,
Nov 13, 2015, 4:48:50 AM11/13/15
to PouchDB
Also, my documents can't be updated so I guess I don't need to deal with rev, not sure though

Jeremy Vuillermet

unread,
Nov 13, 2015, 5:08:17 AM11/13/15
to PouchDB
Ok I feel idiot but if I use the same host on the same computer, obviously the local db will sync together thus the 'push'. My bad


On Friday, November 13, 2015 at 10:42:40 AM UTC+1, Jeremy Vuillermet wrote:
Reply all
Reply to author
Forward
0 new messages