-
Notifications
You must be signed in to change notification settings - Fork 230
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
Evolve enrollment error handling sdk-294 #4186
Conversation
Codecov Report
@@ Coverage Diff @@
## main #4186 +/- ##
===========================================
+ Coverage 64.42% 74.89% +10.46%
===========================================
Files 56 44 -12
Lines 4613 4015 -598
===========================================
+ Hits 2972 3007 +35
+ Misses 1641 1008 -633
Continue to review full report at Codecov.
|
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.
Just a couple of nits, but this looks good to me!
) { | ||
Ok(enrollment) => enrollment, | ||
Err(e) => { | ||
log::error!("evolve_enrollment(\n\tprev_exp: {:?}\n\t, next_exp: {:?}, \n\tprev_enrollment: {:?})\n\t returned an error: {}; dropping this record", prev_experiments.get(slug).copied(), Some(next_experiments.get(slug).copied()), prev_enrollment, e); |
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.
❤️
This changes the evolve_enrollments error handling to discard invalid records, rather than simplying blowing up and letting the error propagate up the stack.
It has an integration test for apply_updates. I thought about writing one for set_global_opt_out, but I'm not convinced it provides much additional information, at least as relevant to this patch. Which is to say that there shouldn't be errors that such a test would catch that this patch fixes and wouldn't already be caught by the apply_updates integration test.
Pull Request checklist
[ci full]
to the PR title.