[FSSDK-11505] update cache interface#1051
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR updates the cache interface to be consistent with other SDKs by renaming and refactoring cache-related types and methods. Key changes include replacing “Cache” with “Store” and updating method names (e.g. get → lookup, set → save, clear → reset) across the codebase and tests.
Reviewed Changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/utils/cache/store.ts | Introduces new cache interfaces (OpStore) and updated implementations with batched getters. |
| lib/utils/cache/store.spec.ts | Updates test cases to use the new SyncPrefixStore and AsyncPrefixStore. |
| lib/utils/cache/local_storage_cache.browser.ts | Changes implementation to adopt SyncStore. |
| lib/utils/cache/in_memory_lru_cache.ts | Renames methods (get→lookup, set→save, clear→reset) and removes getBatched implementation. |
| lib/utils/cache/in_memory_lru_cache.spec.ts | Updates tests to match the new method names and behavior. |
| lib/utils/cache/cache.ts | Refactors the cache API to use OpCache and related types. |
| lib/utils/cache/async_storage_cache.react_native.ts | Adapts cache implementation to use AsyncStore. |
| lib/tests/mock/mock_cache.ts | Updates mock implementations with new Store interface methods. |
| lib/project_config/, lib/odp/segment_manager/, and others | Adjust code to import and use the new Store interfaces and method names. |
| lib/event_processor/* and related test/spec files | Replace PrefixCache references with PrefixStore and update method calls. |
| lib/core/decision_service/cmab/cmab_service.ts | Updates cache operations (clear→reset, get→lookup, set→save) for CMAB caching. |
junaed-optimizely
approved these changes
May 15, 2025
Contributor
junaed-optimizely
left a comment
There was a problem hiding this comment.
LGTM!
Please update the copyright years in mentioned files.
c1c6161 to
0b868f5
Compare
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.
Summary
Test plan
Issues