Skip to content

Conversation

@petruki
Copy link
Member

@petruki petruki commented Jan 9, 2026

This pull request adds a new capability to flush (clear) cached throttling results for a specific switcher, and documents this feature. It also introduces related utility and test code to ensure correct behavior. The most important changes are grouped below:

New Feature: Flush Cached Throttling Results

  • Added a flushExecutions() method to the Switcher class, allowing users to clear cached execution results for a specific switcher. (src/switcher.js)
  • Implemented the clearByKey() static method in ExecutionLogger to support clearing results by switcher key. (src/lib/utils/executionLogger.js)
  • Updated the documentation to describe how to use the new flush functionality. (README.md)

Testing and Validation

  • Added a functional test to verify that flushExecutions() removes cached executions for a switcher. (tests/switcher-functional.test.js)
  • Minor update to the async call example in the playground test to use the correct method and clarify remote API requirements. (tests/playground/index.js)

@petruki petruki added this to the v4.5.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 87389bc into master Jan 9, 2026
13 checks passed
@petruki petruki deleted the staging branch January 9, 2026 17:50
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.

2 participants