Fixes #374 - prevent invalidate cache reference when async #375
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.



This pull request introduces improvements to how strategy inputs are managed in the Switcher client SDK, refactors entry handling for better consistency, and adds new tests to ensure correct behavior when flushing and changing strategy inputs. The changes focus on providing a more robust and predictable API for managing strategy entries and their lifecycle.
Entry management and API improvements:
flush()method toSwitcherBuilderthat clears all previously added entries, replacing the olderresetEntry()method and providing a more consistent way to reset strategy inputs. [1] [2]check()method inSwitcherBuilderto remove existing entries for the same strategy before adding a new one, ensuring only the latest input for a strategy is considered.SwitcherRequestby replacing direct list clearing with the newflush()method, standardizing entry management across the codebase. [1] [2]Result mapping and correctness fixes:
Mapper.mapFromto ensure that a copy of the current entry list is set in the result only when entries are present, preventing unintended mutations.Other minor changes:
Entry.equalsmethod to correctly returnfalsewhen objects are not equal.These changes collectively improve the reliability and clarity of strategy input handling in the SDK.