Skip to content

feat: added flushExecutions to clear cached results#100

Merged
petruki merged 1 commit intomasterfrom
staging
Jan 9, 2026
Merged

feat: added flushExecutions to clear cached results#100
petruki merged 1 commit intomasterfrom
staging

Conversation

@petruki
Copy link
Member

@petruki petruki commented Jan 9, 2026

This pull request introduces a new feature to flush cached executions for a specific switcher, updates relevant documentation, and includes minor improvements and tests to support this functionality. The main focus is to allow users to clear throttled or cached results for a given switcher key, improving control over feature flag evaluations.

New Feature: Flush Cached Executions

  • Added a flushExecutions() method to the Switcher class that clears cached executions for the current switcher key by calling the new ExecutionLogger.clearByKey() utility. [1] [2]
  • Documented the new flushExecutions() method in the README.md with usage examples for users.
  • Added a functional test to verify that flushExecutions() properly clears cached executions for a specific switcher key.

Minor Improvements

  • Improved the isItOn() method in Switcher to always return a resolved promise when called asynchronously, ensuring consistent async behavior.
  • Clarified documentation for the execute method parameter to indicate it can accept a switcher key or a forceAsync boolean.
  • Updated test setup in tests/playground/index.ts to accurately reflect requirements and usage of async calls.

@petruki petruki added this to the v2.4.1 milestone Jan 9, 2026
@petruki petruki self-assigned this Jan 9, 2026
@petruki petruki added the enhancement New feature or request label Jan 9, 2026
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 9, 2026

@petruki petruki merged commit 82e20a0 into master Jan 9, 2026
7 checks passed
@petruki petruki deleted the staging branch January 9, 2026 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant