mikebronner / laravel-model-caching

Eloquent model-caching made easy.
MIT License
2.25k stars 212 forks source link

Testing for clearing of eager loaded non cacheable relations #297

Closed Hornet-Wing closed 4 years ago

Hornet-Wing commented 4 years ago

This is a test to demostrate the bug discussed in #292. I have tried to use existing test classes and models but I can adapt it to create bespoke ones. Let me know if this is OK.

mikebronner commented 4 years ago

@Hornet-Wing Awesome! I will try to get to it this weekend. :)

mikebronner commented 4 years ago

@Hornet-Wing Go ahead and give release 0.7.2 a try. The final implementation ended up being that any queries that have non-catchable eager-loaded relationships will not be cached in their entirety to avoid the cache of the relationship going stale. There really was no other way around that.

Hornet-Wing commented 4 years ago

Sorry it took me a little while to get this tested. Unfortunetly my main project is still 5.8 so I created a seperate project to test this in isolation.

Unfortunetly it still doesnt quite work as expected. I'm planning on taking a closer look, maybe my tests were wrong. :/

https://github.com/Hornet-Wing/model-cache-eager-load