forked from mozilla/application-services
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Wire up persistence of enrolled experiments. (mozilla#39)
* experiments and enrollment status are all stored in the DB. Only fetches experiments in the constructor if there are none in the DB, which doesn't smell like the right thing long term - otherwise though, you must explicitly call `update_experiments()`. We should work out what behaviour makes sense for apps here. * Fully implements the `opt_out` etc methods. Any experiment can be opted in to and opted out of, with this stored in the DB. Calling `update_experiments()` will not change the opted-on/out status - there's a new 'reset_enrollment` function that does though. Note that opting out is fully supported, but the expectation is that this must only be used in a dev or test context. * When `update_experiments()` is called, enrollments for experiments which no longer exist are removed, and new experiments are evaluated for enrollment. We don't emit any events yet, but we could. We do log so you can see things happening. We don't support experiments being paused, nor start and end dates for experiments, etc. * It allows you to opt in/out/etc to non-existing experiments - but they will be removed when `update_experiments()` is called (ie, it's treated as though the experiment was removed. We could fix this, but meh. * No longer hits the server as the SDK interface is constructed. * Our command-line utility `experiment.rs` supports all of this - use --help.
- Loading branch information
Showing
10 changed files
with
824 additions
and
180 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
{ | ||
"context": {"app_id": "101010", "locale": "en-US"}, | ||
"collection_name": "messaging-experiments", | ||
"bucket_name": "main", | ||
"uuid": "d7bb442c-81ef-4d0d-bd14-fedb3b67ccd4" | ||
"collection_name": "nimbus-mobile-experiments", | ||
"bucket_name": "main" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.