Fix caching feature flag being ignored#38
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Fix issue #37: disabling the
cachingfeature in configuration did not actually prevent the filter from using cached query results when a cache repository was injected. As a result, repeated requests could return stale or unfiltered data instead of re-running the filter logic.Approach
Remove the constructor behavior that implicitly enabled caching whenever a cache repository was provided. Caching now respects the configured feature defaults, so
caching: falsestays off unless it is explicitly enabled by code or configuration. Add regression coverage for both the disabled-by-default path and the explicit-enable path.Open Questions and Pre-Merge TODOs
This was verified by running
./vendor/bin/phpunit tests/Unit/CachingTest.php tests/Unit/FilterTest.php.Learning
The cache repository injection should not be treated as an implicit feature toggle. The constructor must preserve configuration-driven feature defaults, while callers who want caching can still enable it explicitly.