Skip to content

Fix caching feature flag being ignored#38

Merged
Thavarshan merged 1 commit into
mainfrom
fix/issue-37-disable-caching-auto-enable
May 6, 2026
Merged

Fix caching feature flag being ignored#38
Thavarshan merged 1 commit into
mainfrom
fix/issue-37-disable-caching-auto-enable

Conversation

@Thavarshan

@Thavarshan Thavarshan commented May 6, 2026

Copy link
Copy Markdown
Owner

Purpose

Fix issue #37: disabling the caching feature 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: false stays 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

  • Confirmed with focused PHPUnit coverage that the disabled path no longer calls the cache repository.
    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.

@Thavarshan Thavarshan self-assigned this May 6, 2026
@Thavarshan Thavarshan added bug Something isn't working enhancement New feature or request help wanted Extra attention is needed labels May 6, 2026
@Thavarshan Thavarshan merged commit e2cb303 into main May 6, 2026
13 checks passed
@Thavarshan Thavarshan deleted the fix/issue-37-disable-caching-auto-enable branch May 6, 2026 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request help wanted Extra attention is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant