Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Client.React/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Format: `## ` release headings and single-line `- ` bullets only — no bold, li

## 2026-10-04

- Fixed: right after a score or during a timeout, live game cards showed the ball at a stale spot with a possession arrow even though nobody had the ball — the field graphic now hides until the next play
- Improved: live covering/bloody alerts now come as one notification per team that lists each of your leagues and how many picked it there (e.g. "Alpha: your pick + 1 other") instead of a separate notification per league
- Changed: the NFL and college apps now each have their own notification settings, and each app only gets its own sport's alerts — turn on push in the NFL app for NFL alerts and in the college app for college alerts (your existing settings were copied to both)
- Fixed: NFL notifications also arrived on the college app (and vice versa) when both were installed — each app now only gets its own sport's alerts
Expand Down
14 changes: 14 additions & 0 deletions Server.UnitTests/LiveGameDtoTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,20 @@ public void FromCompetition_SituationIsNull_WhenCompetitionHasNoSituation()
Assert.Null(dto.Situation);
}

// Between plays — kickoff after a score, timeouts, end of quarter — ESPN sends a situation with
// no possession (and a stale yardLine). Showing a ball and an arrow then is wrong (owner report:
// DET@CAR right after a CAR field goal), so no possession means no field graphic at all.
[Fact]
public void FromCompetition_SituationIsNull_WhenEspnReportsNoPossession()
{
var competition = BuildCompetition(possessionId: null);
competition.Situation = new EspnSitutation { Possession = null, YardLine = 35, Down = -1, IsRedZone = true };

var dto = LiveGameDto.FromCompetition(competition);

Assert.Null(dto.Situation);
}

// ── IsRedZone ─────────────────────────────────────────────────────────────

[Fact]
Expand Down
9 changes: 6 additions & 3 deletions Shared/Models/Data/Dtos/LiveGameDto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,19 @@ public class GameSituationDto
public bool IsRedZone { get; set; }
public string DownDistanceText { get; set; } = string.Empty;

internal static GameSituationDto FromSituation(EspnSitutation situation, Competitor home, Competitor away)
// Null when nobody has the ball (kickoff after a score, timeouts, end of quarter) — ESPN still
// sends a situation then, with a stale yardLine, and drawing a ball + arrow from it is wrong.
internal static GameSituationDto? FromSituation(EspnSitutation situation, Competitor home, Competitor away)
{
var possessor = situation.Possession == home.Id ? home
: situation.Possession == away.Id ? away
: null;
if (possessor is null) return null;

return new GameSituationDto
{
PossessionTeam = possessor?.Team.Abbreviation,
IsHomePossession = possessor?.HomeAway == HomeAway.Home,
PossessionTeam = possessor.Team.Abbreviation,
IsHomePossession = possessor.HomeAway == HomeAway.Home,
YardLine = situation.YardLine,
Down = situation.Down,
Distance = situation.Distance,
Expand Down
Loading