File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
main/java/com/featureprobe/sdk/server/model
test/groovy/com/featureprobe/sdk/server Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ public Split(List<List<List<Integer>>> distribution) {
3636
3737 public HitResult findIndex (FPUser user , String toggleKey ) {
3838 String hashKey = user .getKey () != null ? user .getKey () : String .valueOf (System .nanoTime ());
39+ user .stableRollout (hashKey );
3940 if (StringUtils .isNotBlank (bucketBy )) {
4041 if (user .containAttr (bucketBy )) {
4142 hashKey = user .getAttr (bucketBy );
Original file line number Diff line number Diff line change @@ -27,5 +27,16 @@ class SplitSpec extends Specification {
2727 }
2828 }
2929
30+ def " User not has key" () {
31+ when :
32+ user = new FPUser ()
33+ def result1 = split. findIndex(user, " test_toggle_key" )
34+ def key1 = user. key
35+ def result2 = split. findIndex(user, " test_toggle_key" )
36+ def key2 = user. key
37+ then :
38+ key1 == key2
39+ result1. index. get() == result2. index. get()
40+ }
3041
3142}
You can’t perform that action at this time.
0 commit comments