We are on 4.6.18 and Drupal. The code in CRM\Contact\BAO\GroupContactCache.php has updated since 4.6.17.
We have users joining our public site to get a Drupal username and a CiviCRM membership (having paid a contribution). They then have a link to view and update their profile. When new users click to view their profile, they see "Permission Denied You do not have permission to view this contact record. Contact the site administrator if you need assistance."
From looking at the code, this message appears if the contact is not in the profile's group. The CiviCRM profile does indeed Limit listing to a specific group, which is a smart group with contacts with the relevant membership types. Our smart group timeout is zero so it should update immediately. However this seems not now to be happening. If I "Cleanup Caches" then the contact is put in the group and it works fine.
I haven't got detailed evidence but it seemed like our smart group cache was never updating.
I could set the cache timeout and set up a scheduled task to rebuild the smart group cache. However this would not be ideal.
I haven't looked at GroupContactCache.php Has the above behaviour changed in recently? How can I fix this? Or any other suggestions on how to avoid this problem?