Skip to content

[FSSDK-11505] update cache interface #1051

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 15, 2025
Merged

[FSSDK-11505] update cache interface #1051

merged 3 commits into from
May 15, 2025

Conversation

raju-opti
Copy link
Contributor

Summary

  • update the cache interface to be consistent with other sdks.

Test plan

Issues

  • FSSDK-11505

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@coveralls
Copy link

coveralls commented May 14, 2025

Coverage Status

coverage: 80.643% (-0.07%) from 80.712%
when pulling 0b868f5 on raju/cache_methods
into db81531 on master.

Copy link
Contributor

@junaed-optimizely junaed-optimizely left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Please update the copyright years in mentioned files.

@raju-opti raju-opti force-pushed the raju/cache_methods branch from c1c6161 to 0b868f5 Compare May 15, 2025 14:37
@raju-opti raju-opti merged commit e1190c6 into master May 15, 2025
13 of 17 checks passed
@raju-opti raju-opti deleted the raju/cache_methods branch May 15, 2025 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants