Open Crash-- opened 4 years ago
ATM, we do not share code logic between those 2 links.
For instance we implement in both side the method to generate the name and the fields for an instance : https://github.com/cozy/cozy-client/blob/master/packages/cozy-pouch-link/src/CozyPouchLink.js#L284-L285
https://github.com/cozy/cozy-client/blob/master/packages/cozy-stack-client/src/DocumentCollection.js#L337-L339
And if we look closer to https://github.com/cozy/cozy-client/blob/cdf570a6dad2ec484c5a0537510bd68559272f4b/packages/cozy-stack-client/src/DocumentCollection.js#L428 we see that we're not using indexedField at all and it's problematic. (PR coming to fix that specific issue).
indexedField
I'm wondering if we have more logic than just "indexedField" we can share between Stack and PouchLink.
I like the idea submitted by @paultranvan (come on, you have read the PouchDB's logs too much) to create a cozy-query-plan module.
cozy-query-plan
@ptbrowne Any objection? or ideas?
Let's see how & when we can do that :)
ATM, we do not share code logic between those 2 links.
For instance we implement in both side the method to generate the name and the fields for an instance : https://github.com/cozy/cozy-client/blob/master/packages/cozy-pouch-link/src/CozyPouchLink.js#L284-L285
https://github.com/cozy/cozy-client/blob/master/packages/cozy-stack-client/src/DocumentCollection.js#L337-L339
And if we look closer to https://github.com/cozy/cozy-client/blob/cdf570a6dad2ec484c5a0537510bd68559272f4b/packages/cozy-stack-client/src/DocumentCollection.js#L428 we see that we're not using
indexedField
at all and it's problematic. (PR coming to fix that specific issue).I'm wondering if we have more logic than just "indexedField" we can share between Stack and PouchLink.