Leaderboard submission failure (error included)

We had the trouble with identical scores, that I thought I solved by adding a subscore that was an inverse timestamp (long.MaxValue - TimestempInSecondsFrom_1_1_2021). But once this subscore was set, any new highscore wouldn’t register and nakama gave me this error:

{“level”:“error”,“ts”:“2021-04-14T11:43:26.255Z”,“caller”:“server/core_leaderboard.go:381”,“msg”:“Error writing leaderboard record”,“error”:“ERROR: integer out of range (SQLSTATE 22003)”}

When I deleted my old record with a this subscore: 9223372036845836116, then it registered scores again. Maybe something to do with the long-subscore?

@nixarn Both score and subscore fields are BIGINT types which have a range of -9223372036854775808 to +9223372036854775807. I think the problem could be to do with the partial updates to the score and subscore logic after the initial record is written because your value looks like it’s within 8939691 of the max value. Can you open an issue and we’ll take a look? Thanks :pray:

Ok sure, I’ll open an issue, I’ll do some testing when exactly is happens before doing so (that’ll be tomorrow, getting late here). Thanks for the reply, quick as always =)

1 Like