Closed petteripitkanen closed 5 years ago
I have tried to check this in following way:
Based on this I believe that npm run migrate is updating indexed database even with admin credentials, if json file objects get changed. But I am not sure if this should be working in this way, however it might shed a light on how to solve issue.
Thanks, indeed it seems if admin directly edits server database then there is no problem and the changes do get synchronized to clients. This works:
curl -X GET http://localhost:8080/db/crops/ID
to get current json of a cropcurl -H 'Content-Type: application/json' -X PUT http://admin:admin@localhost:8080/db/crops/ID -d 'edited-json-here'
This stopped working after admin user and design document were set for the database:
npm run cli -- pouch-clone
npm run cli -- pouch-update ID --document=property:value
npm run cli -- pouch-sync
I'm guessing there is some problem with pouchdb
when using local databases on Node.
Fixing #63 by #66 introduced a bug when admin tries to edit the database after the initial
npm run migrate
, for some reason their changes don't get synchronized to clients.