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

Incorrect bidder id when generating a bid #30

Open
absoludity opened this issue Jul 14, 2022 · 0 comments
Open

Incorrect bidder id when generating a bid #30

absoludity opened this issue Jul 14, 2022 · 0 comments

Comments

@absoludity
Copy link

The current code for BidGenerator.nextBid incorrectly adds the FIRST_PERSON_ID two times to the value returned by nextBase0PersonId() call (see lines 84 and 100 below):

bidder += GeneratorConfig.FIRST_PERSON_ID;
long price = PriceGenerator.nextPrice(random);
String channel;
String url;
if (random.nextInt(HOT_CHANNELS_RATIO) > 0) {
int i = random.nextInt(HOT_CHANNELS.length);
channel = HOT_CHANNELS[i];
url = HOT_URLS[i];
} else {
Tuple2<String, String> channelAndUrl = CHANNEL_URL_CACHE.get(random.nextInt(CHANNELS_NUMBER));
channel = channelAndUrl.f0;
url = channelAndUrl.f1;
}
bidder += GeneratorConfig.FIRST_PERSON_ID;

I only noticed because I'm writing unit-tests (to better understand what each function intends) while porting the data source to rust and my test failed :P.

Or if there is some reason why the FIRST_PERSON_ID is added twice intentionally, perhaps place those together with a comment - but as it is, I'm assuming it's unintended.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant