RL event scores are inconsistently typed

Issue Description:

OW versions tested: and

In RL events, scores are either numbers or strings and I don’t see any pattern for when which one is used. The biggest problem, however, is that this inconsistency carries over across games and clients, so sometimes the exact same event will use a string for score and other times it will use a number. This also means that two players competing and reporting their results to us may end up submitting the same events, with with differently typed scores. Unfortunately, this does happen and it mucks with our result validation.

This is not the first time OW has been using strings instead of numbers and it’s not the first time that has bitten us as a result (another relevant ticket is here).

There are logs attached showing the same match (played at 09:39 PT on 2019-11-27) from two different OW clients. Each one reports scores with different types. However, again, this varies per-match, even with the same two clients.

Example of the score event with a number score (110):

{"events": [{
		"name": "score",
		"data": "{\r\n  \"steamId\": \"76561198933578234\",\r\n  \"score\": 110,\r\n  \"goals\": \"1\",\r\n  \"deaths\": \"0\",\r\n  \"name\": \"sr531\",\r\n  \"state\": \"0\",\r\n  \"team_score\": 1,\r\n  \"team\": \"1\",\r\n  \"index\": 1\r\n}"

Example of score event with a string score ("180"):

{"events": [{
		"name": "score",
		"data": "{\r\n  \"steamId\": \"76561198933578234\",\r\n  \"score\": \"180\",\r\n  \"goals\": \"1\",\r\n  \"deaths\": \"0\",\r\n  \"name\": \"sr531\",\r\n  \"state\": \"0\",\r\n  \"team_score\": \"1\",\r\n  \"team\": \"1\",\r\n  \"index\": 1\r\n}"

Steps to reproduce:

Nothing special. Just play an RL private 1v1 with OW and capture some events. Then look at the events and see how the scores are typed.

Impact for my app: [low, mid, high, show-stopper]

This is high priority, at least, since it breaks our result validation. We’re looking to go live with real money matches in the next couple of months and we need the OW result submissions to be solid.

Suggested fix:

The most important thing is consistency. However, following that is maintainability. Using strings for numbers anywhere in these events doesn’t make much sense to me. I would like to see the whole domain cleaned up to use numbers wherever applicable, which would minimize the amount of parsing which needs to be done and would help ensure entire classes of bugs (like the one linked above) don’t show up.

Please attach a zip package of your logs
OverwolfLogs_2019-11-27_09-40-15.zip (1.3 MB)
OverwolfLogs_2019-11-27_09-40-27.zip (2.2 MB)

Yesterday we released a fix for the RL victory/defeat events, this fix required us to change the score from string to int.
Next time we’ll announce these kind of changes in advance.

@Shargaas @eransharv

Ah, I see. If one bit of scores are numbers, I really think the rest should be, too. Either that or they should all stay strings and OW should parse before comparing them. The inconsistency here is going to be a big pain for every dev.

1 Like

I agree. We are working to normalize our API. It’s not so easy as a lot of apps are relay on specific structures and types so that any change can break the apps. But eventually and step by step, we will enhance the API and finish these kinds of tasks (consistent return types, etc.).