pouchdb-community / ember-pouch

PouchDB/CouchDB adapter for Ember Data
Apache License 2.0
281 stars 76 forks source link

Querying Adding Record to Ember Data #182

Open bartam opened 7 years ago

bartam commented 7 years ago

I'm going nuts trying to debug this.

When I do a this.store.query('model',{filter: filter}) , it will add a record to my model. However, if I rerun the query inside the session, it won't add a record. These records aren't saved, but somewhere, it's doing a store.createRecord('model',filter). Running with debug messages, it shows the correct record count, however.

So if I did a store.findAll('model') which returned 1. Then ran a store.query..., findAll would return 2. Running the store.query... again, findAll would return 2 still. If I reloaded the page, findAll would return 1 again, as it should.

I'm thinking I'm missing a critical concept of couchDB/pouchDB.

broerse commented 7 years ago

Not sure it is related to https://github.com/emberjs/data/issues/4463 but try what happens if you set coalesceFindRequests: false, in your adapter.

bartam commented 7 years ago

No change.

broerse commented 7 years ago

In version 4.2.6 released today we Fixed a queryRecord deprecation. It does not seem to be related to this issue but just to be sure update to this version. Perhaps we need to setup a https://ember-twiddle.com/ to see this issue.

akatov commented 7 years ago

ember-twiddle doesn't let you access indexeddb. So ideally one would want access to the pouch memory adapter as an ember addon for this...