Skip to content
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

fix: increase the possible random numbers used for stickiness id #241

Merged

Conversation

thomasheartman
Copy link
Contributor

@thomasheartman thomasheartman commented Sep 19, 2024

Same fix as done in some other sdks, such as the node one at
Unleash/unleash-client-node#417

Fixes an issue where 1% rollout would not yield any results with
random rollout for certain group ids

Same fix as done in some other sdks, such as the node one at
https://github.com/Unleash/unleash-client-node/pull/417o

Fixes an issue where 1% rollout would not yield any results with
random rollout for certain group ids
Copy link
Member

@sighphyre sighphyre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@sighphyre sighphyre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait no. Wait this looks weird. Random.Next() returns a 32 bit integer. I don't think multiplying it by anything is going to help here. I think that's just going to make it overflow and do weird things

Kinda think this one maybe needs a test

@thomasheartman
Copy link
Contributor Author

Yeh, replaced it with a bounded random between 1 (inclusive) and 10,001 (exclusive) instead of doing the same math as before.

@thomasheartman
Copy link
Contributor Author

@sighphyre Added a test that appears to be working fine. You good with merging it?

@thomasheartman thomasheartman merged commit f682075 into main Sep 24, 2024
2 checks passed
@thomasheartman thomasheartman deleted the fix/1-2864-investigate-rollout-distribution-issues branch September 24, 2024 07:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants