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
fix(track): Batch decision payloads into the same array in the snapshot. #155
Conversation
build |
build-e2e |
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.
Does getImpressionEventParams
need this change too?
@@ -1272,16 +1272,7 @@ describe('lib/optimizely', function() { | |||
'campaign_id': '4', | |||
'experiment_id': '111127', | |||
'variation_id': '111129' | |||
}], | |||
'events': [{ |
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.
Why is this no longer in the snapshot?
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.
It is, it gets added on line 154. It's just that instead of having the event duplicated for every decision, we just send one event per snapshot.
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.
oh okay cool
So impression does not need to change because at the moment we only ever |
Got it, thanks! I found the PR name seems kinda misleading, is this name/description accurate?
edit: I got this wrong, it should be something like 'Send all decisions in the same snapshot as the conversion event' or something. |
@@ -1272,16 +1272,7 @@ describe('lib/optimizely', function() { | |||
'campaign_id': '4', | |||
'experiment_id': '111127', | |||
'variation_id': '111129' | |||
}], | |||
'events': [{ |
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.
oh okay cool
Before it was many snapshots, each with exactly one decision and one conversion event. This is not accurate because decisions for the experiments attached to the same event should be in the same snapshot.
Only conversion events need to have this special logic, because impression events only come from
activate
andisFeatureEnabled
API (and transitively,getEnabledFeatures
), which all submit a single impression event for just one experiment.