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 bug with filtering items in IRA incentives #530

Merged
merged 1 commit into from
Jul 16, 2024
Merged

Conversation

oyamauchi
Copy link
Member

Description

Reported in #525

The assumption that items is a singleton for IRA incentives was
broken a while ago. This meant that some IRA incentives were
incorrectly getting filtered out, because only items[0] was being
checked for overlap with request.items, rather than all of them.

The first-party calculator wasn't affected by this, because it passes
all the items in every query.

Test Plan

yarn test. This case was being exercised by an existing snapshot
test. The bug was introduced in 77d0ff6 and I dutifully updated the
snapshot there, but didn't notice the problem.

## Description

Reported in #525

The assumption that `items` is a singleton for IRA incentives was
broken a while ago. This meant that some IRA incentives were
incorrectly getting filtered out, because only `items[0]` was being
checked for overlap with `request.items`, rather than all of them.

The first-party calculator wasn't affected by this, because it passes
all the items in every query.

## Test Plan

`yarn test`. This case was being exercised by an existing snapshot
test. The bug was introduced in 77d0ff6 and I dutifully updated the
snapshot there, but didn't notice the problem.
@oyamauchi oyamauchi requested a review from matelau July 15, 2024 16:46
@oyamauchi oyamauchi merged commit e839b00 into main Jul 16, 2024
1 check passed
@oyamauchi oyamauchi deleted the owen.item-filter branch July 16, 2024 19:15
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

Successfully merging this pull request may close these issues.

2 participants