-
Notifications
You must be signed in to change notification settings - Fork 269
Invoke on_assignment
callback after assignment is stored in database; add global on_assignment
callback
#368
Invoke on_assignment
callback after assignment is stored in database; add global on_assignment
callback
#368
Conversation
…t callbacks Added after_assignment callback and specs Minor fixes
@bensheldon could you also take a look at this? 👀 |
…nd-after-assignment-callback
Just to summarize what I'm seeing here.
Reading the original code, I want to suggest a completely different direction too:
|
Yep, it's already working that way. Default callback can be overridden in Experiment
Yep, I agree that we may don't add |
…nd-after-assignment-callback
Call on_assignment after connection.ab_add_participant
@frostmark this looks good. Let me know when I should review. |
@bensheldon this is ready for review |
on_assignment
callback
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.
👍 Looks good. Thanks for the discussion on this.
return if index == connection.ab_showing(@id, identity) | ||
return if connection.ab_seen @id, identity, index |
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.
I spent some time looking at this, because this guard clause was lifted up out of the #call_on_assignment_if_available
method. I think it's safe and an improvement because it ensures re-assigning the same assignment.
on_assignment
callbackon_assignment
callback; invoke callback after assignment is stored in database instead of before
on_assignment
callback; invoke callback after assignment is stored in database instead of beforeon_assignment
callback after assignment is stored in database; add global on_assignment
callback
Released in |
MVP for #367
on_assignment
andafter_assignment
Addedafter_assignment
callback and specsEdit: final version of this PR does not include an
after_assignment
callback. Instead, theon_assignment
callback's call has been moved after the assignment is preserved in the database.