Actions
Bug #18
openGoal.empty_net field not being set correctly
Status:
Backlog
Priority:
High
Assignee:
-
Start date:
01/17/2026
Due date:
% Done:
0%
Estimated time:
Description
The Goal.empty_net boolean field is not being populated correctly. There are 521 goals where goalie_id is nil (indicating no goalie in net) but empty_net is false.
Current Behavior¶
- Goals with
goalie_id: nil: 521 - Goals with
empty_net: true: 0
Expected Behavior¶
Goals without a goalie should have empty_net: true.
Root Cause Investigation¶
The extraction logic in shot_goal_extraction_service.rb line 270:
empty_net: play.strength.present? ? play.strength == "EN" : play.goalie_in_net_id.nil?
This suggests either:
- Older data was extracted before this logic existed
- The
play.strengthfield is present but not "EN" in some cases (e.g., power play empty net situations)
Impact¶
- Low priority - danger zone generation already excludes empty net shots via
.where.not(goalie_id: nil)filter - Affects any queries that rely on
Goal.empty_netfield
Fix Needed¶
- Review the extraction logic to handle edge cases (e.g., PP empty net goals)
- Backfill existing goals:
Goal.where(goalie_id: nil).update_all(empty_net: true)
No data to display
Actions