sportradar / UnifiedOddsSdkNetCore

UnifiedFeed SDK is a client library that enables easier integration with the Betradar XML feeds. SDK exposes XML feed service interface in a more user-friendly way and isolates the client from having to do XML feed parsing, proper connection handling, error recovery, event queuing, data caching and dispatching.
https://sportradar.github.io/UnifiedOddsSdkNetCore/
Other
17 stars 14 forks source link

HomeScore and AwayScore should be Nullable<decimal> on MatchStatus class #6

Closed micdenny closed 2 years ago

micdenny commented 4 years ago

The HomeScore and AwayScore are nullable fields/properties on SportEventStatusDTO , SportEventStatusCI and SportEventStatus, but when it comes to map on MatchStatus the fields become non-nullable, this could lead into issue while updating scoreboard info.

https://github.com/sportradar/UnifiedOddsSdkNetCore/blob/43f34aa4b901f64395c1af00d09465f687556806/src/Sportradar.OddsFeed.SDK/Entities/REST/Internal/DTO/SportEventStatusDTO.cs#L54-L62

https://github.com/sportradar/UnifiedOddsSdkNetCore/blob/43f34aa4b901f64395c1af00d09465f687556806/src/Sportradar.OddsFeed.SDK/Entities/REST/Internal/Caching/Events/SportEventStatusCI.cs#L30-L38

https://github.com/sportradar/UnifiedOddsSdkNetCore/blob/43f34aa4b901f64395c1af00d09465f687556806/src/Sportradar.OddsFeed.SDK/Entities/REST/Internal/EntitiesImpl/SportEventStatus.cs#L46-L54

and here's the glitch:

https://github.com/sportradar/UnifiedOddsSdkNetCore/blob/43f34aa4b901f64395c1af00d09465f687556806/src/Sportradar.OddsFeed.SDK/Entities/REST/Internal/EntitiesImpl/MatchStatus.cs#L52-L62

and here's what can happen when only partial fields are sent:

2020-08-05T12:12:37.8814123+02:00 [INF] Incoming message 'GetStatusAsync' [22899555]

{
"EventResults": null,
"EventClock": null,
"AwayPenaltyScore": null,
"AwayScore": 0,
"DecidedByFed": null,
"HomePenaltyScore": null,
"HomeScore": 0,
"PeriodScores": null,
"ReportingStatus": 99,
"Status": 1,
"WinnerId": null,
"Properties": {
"Period": 0,
"WinnerId": null,
"WinningReason": null,
"AggregateWinnerId": null,
"Status": 1,
"MatchStatus": 7
}
}
dhrovat commented 2 years ago

That is already available, but MatchStatus must be casted to IMatchStatusV1. Available since v1.6.0.0 (5/11/2020).