Data processor appears to cache previous search results on some occasions
I have a data processor that is constructed using the permissioned contact source. Users of the system are experiencing an intermittent error with the dataprocessor. Here is an example use case:
I have two different users of the system: A and B, each has permission to see a different set of contacts (in this case, members in their local area).
- User A runs the search and it works fine for her.
- User B then tries to do the search but it does not return any results
- An admin logs in who has permission to see all contacts but her results are limited to those that User A should see.
It felt like there was some caching going on here but I wasn't sure where.
@jaapjansma - you pointed me to this line: https://lab.civicrm.org/extensions/dataprocessor/-/blob/master/CRM/Dataprocessor/BAO/DataProcessor.php#L67.
From a cursory glance, I looks like I could attempt a hot fix by commenting out attempt to retrieve the dataprocessor from the cache.
I've experienced similar problems in the past where old criteria appear to be cached but only for particular users. i.e. a data processor works for some but not others. Unfortunately, I can't remember whether ACL was involved but it makes me wonder what kind of performance gain we are getting from caching and whether it is worth it. I appreciate that I have very little knowledge of the mechanics of the cache and totally understand that you might not want to remove a cache on the basis of such flimsy anecdotal evidence but wanted to ask the question / get the conversation started in any case.
Otherwise, we have to work out when to invalidate the cache, right? I seem to remember someone telling me that cache invalidation is easy :)