Mitigate duplicate data capture

I think (have not tested) it is just a matter of changing this check in the CouchDB view and then this value in the app code. Like Gareth said, this will have a significant impact on the size of this Couch view and the subsequent query performance. (And, this view will have to be re-indexed. This will take a long time for any non-trivial data set.)

It is hard to be sure (since it seems like the challenges for stuff like this are always the little things you don’t anticipate), but I briefly had a look through that code and nothing jumped out at me as being particularly difficult to back-port to 4.2. One concern I had was how much it was affected by the Angular upgrade in 4.5, but even that looks tangential to the search changes needed for descendant-of-current-contact

I am curious why you decided to add moment globally instead of just using something like webpack to package it with your extension code? (I would expect that after tree-shaking, the size difference would be pretty minimal in terms of kb of code…) I had always figured the webpack approach would be the cleanest way to do dependencies in extension-libs, so I would like to know if you ran into some kind of problems with that approach! (Also, as a side note, a date_diff function seems like a generic feature that could be useful to many partners. If you are finding it useful, consider perhaps up-streaming it as a built-in CHT function!)

I definitely agree that this really should be a build-in feature in the CHT! Looks like we already have an issue raised, but I have added a link to this conversation:

1 Like