-
Notifications
You must be signed in to change notification settings - Fork 6
feat: add setTracksAssignment #56
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
Conversation
There was a problem hiding this 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 adds a new feature to enable tracking assignment events for variant fetching. The implementation includes a new setTrackAssignmentEvent method that allows users to configure whether assignment events should be tracked when fetching variants.
- Introduces
SingleValueStoreCacheclass for persistent storage of options - Adds
setTrackAssignmentEventmethod to control tracking behavior - Updates dependency version to support new tracking options
Reviewed Changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/storage/cache.ts | Added SingleValueStoreCache class and getVariantsOptionsStorage factory function for persistent storage |
| src/experimentClient.ts | Integrated tracking options storage and implemented setTrackAssignmentEvent method |
| package.json | Updated @amplitude/experiment-core dependency from 0.7.2 to 0.10.0 |
| tests/client.test.ts | Added comprehensive test coverage for the new tracking assignment functionality |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
📝 Documentation updates detected! New suggestion: Document setTrackAssignmentEvent method for React Native SDK |
| /** | ||
| * Set to track assignment event or not for fetching variants. | ||
| * @param doTrack | ||
| */ | ||
| public async setTracksAssignment(doTrack: boolean): Promise<void> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: This could be more concise.
/**
Enables or disables tracking of assignment events when fetching variants.
@param doTrack Whether to track assignment events.
*/
Add
setTracksAssignment.