pouchdb-community / worker-pouch

Easy way to use PouchDB inside a Web Worker or Service Worker
Apache License 2.0
218 stars 34 forks source link

Unable to get the changes - worker and db.changes #9

Closed ronycohen closed 8 years ago

ronycohen commented 8 years ago

When testing the db.changes with the worker adapter :

I encounter a strange behavior with my chrome desktop and the chrome Android in regard to the paste.pouchdb.com.

When using the test script on this site (available here) : http://paste.pouchdb.com/paste/1df1i5 I can see in the console logs that the db.changes listener is working.

image

When I use this code on my Ionic APP client The db.changes listener is not working.

Do you know what is going on, and why I encounter this issue ? ?

Regards, Ron

ronycohen commented 8 years ago

The script is working when using a webServer for the execution.

image

I'm retesting on ANGULARJS / Ionic.

Currently on my app, the db.changes doesn't work at all.

ronycohen commented 8 years ago

This is the result of the script on the Ionic APP (I replaced the current index.html with the script http://paste.pouchdb.com/paste/1df1i5)

I'm don't have the db.changes results

image

nolanlawson commented 8 years ago

I'm sorry, can you please provide some simple steps to reproduce? I don't understand what the problem is, or how to reproduce it.

E.g. fill out this form:

  1. Steps to reproduce
  2. Expected result
  3. Actual result
  4. Platform, browser, etc.
ronycohen commented 8 years ago

I'm on it

1.a db Creation with Worker adapter 1.b db.changes declaration with logging of changes. 1.c db.bulkDocs of 3 docs

  1. catch the changes and get the infos in the logs
  2. Doesn't catch anything
  3. Chrome on Android. Chrome on my laptop

Same with webSql is working.

ronycohen commented 8 years ago

I found the problem.

I wasn't able to see error inside the web worker. I implemented an external variable in the filter property of the db.changes. and the web worker wasn't able to get it, and I did not have any errors :)