Skip to content

VAR reversals: add football match diffing to generate a synth state change event#1857

Draft
vlbee wants to merge 7 commits into
live/var1-gsi-setupfrom
live/var2-addSynthEvent
Draft

VAR reversals: add football match diffing to generate a synth state change event#1857
vlbee wants to merge 7 commits into
live/var1-gsi-setupfrom
live/var2-addSynthEvent

Conversation

@vlbee

@vlbee vlbee commented Jul 16, 2026

Copy link
Copy Markdown
Member

Do not merge until after GSI is created by merging #1856

What does this change?

This PR adds football match state diffing at the point the football Lambda fetches PA data. If a state change is detected, a synthetic state-change event is generated. We filter out those events from being processed by the two EventConsumer classes, so it should be safe to release this PR. There will be a subsequent PR to process and dedupe state change events in the event consumers.

Draft.

How has this change been tested?

How can we measure success?

Have we considered potential risks?

Images

Accessibility

.isMatchStateIdentical(matchDay.id, footballMatchState)
.recover { case NonFatal(exception) =>
logger.error(s"Error checking for for identical football match state ${matchDay.id}: ${exception.getMessage}")
true // assume identical // todo confirm this behaviour is desired.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Is this what should happen?

@github-actions

Copy link
Copy Markdown
Contributor

val payloadBuilder = new MatchStatusLiveActivityPayloadBuilder()
val toFootballEvent = FootballMatchEvent.fromPaMatchEvent(matchDay.homeTeam, matchDay.awayTeam) _

if (events.isEmpty) Future.successful(true) // no stage change before a match has started.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

verify this behaviour withing 2-hr create channel window

.flatMap(row => footballStateFromPayload(row.payload))
.forall(latest => ignoringArticleUrl(latest, state))

// articleUrl is only added to the payload after isMatchStateIdentical is called, so we must ignore it.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Is it safer to compare a checksum?

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.

1 participant