Skip to content

Conversation

@zhukaihan
Copy link
Contributor

@zhukaihan zhukaihan commented Oct 6, 2025

Add setTracksAssignment.

Copy link

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 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 SingleValueStoreCache class for persistent storage of options
  • Adds setTrackAssignmentEvent method 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.

@promptless
Copy link

promptless bot commented Oct 6, 2025

📝 Documentation updates detected!

New suggestion: Document setTrackAssignmentEvent method for React Native SDK

@zhukaihan zhukaihan requested a review from kyeh-amp October 16, 2025 18:23
@zhukaihan zhukaihan changed the title feat: add setTrackAssignmentEvent feat: add setTracksAssignment Oct 28, 2025
Comment on lines 400 to 404
/**
* Set to track assignment event or not for fetching variants.
* @param doTrack
*/
public async setTracksAssignment(doTrack: boolean): Promise<void> {
Copy link

@vaibhav-jain-exp vaibhav-jain-exp Oct 29, 2025

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.
*/

@zhukaihan zhukaihan merged commit 363cf5b into main Nov 10, 2025
9 checks passed
@zhukaihan zhukaihan deleted the add-no-track branch November 10, 2025 22:36
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