Skip to content

Bug when ab_finished action takes place before the ab_test action #576

@gnanou

Description

@gnanou

When an experiment e.g. :my_experiment already exists in Redis and then for a user we have the following flow:

  1. ab_finished(:my_experiment, reset: false)
  2. ab_test(:my_experiment)
  3. ab_finished(:my_experiment, reset: false)

then the completed counter is not increased as expected the second time ab_finished is called.

This happens because the first time ab_finished is called with reset: false option, it will change the ab_user state, setting the experiment's finished_key to true here. This way, when ab_finished is called again, it will return before the completed counter is increased due to this check.

I have a simple solution ready for this issue, checking if the experiment about to finish is active for the user. If you agree I can make a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions