When writing a leaderboard record for an authoritative leaderboard from a LUA-module, an error is sometimes thrown:
"Error when writing leaderboard record: sql: no rows in result set"
It seems to happen occasionally, I haven't found a pattern for when it fails, could be a timing issue.
The lua module I'm using to write is simply a wrapper of the following call:
local success, result = pcall(nk.leaderboard_record_write, json.lbId, ctx.user_id, ctx.username, json.score, json.subscore, json.metadata)
Steps to Reproduce
Create a new leaderboard with the settings above
Submit regular leaderboard records from a lua module for a specific user (every 2 minutes in my case) with the same score and parameters every time
Observe the error eventually
Expected Result
No error is thrown and the score is handled according to the "best" operator.
Actual Result
2021-11-03 17:22:25 DEBUG | nakama | Leaderboard haystack lookup
2021-11-03 17:22:25 WARN | nakama | Failed to write leaderboard character_level_warrior_standard for: 1fd68bb8-0ed5-41f9-89d4-27d010aaf72c: "/nakama/data/modules/leaderboards.lua:182: error writing leaderboard record: sql: no rows in result set"
**2021-11-03 17:22:25 ERROR | nakama | Error writing leaderboard recordsql: no rows in result set**
2021-11-03 17:22:25 WARN | nakama | Failed to write leaderboard character_level_overall_standard for: 1fd68bb8-0ed5-41f9-89d4-27d010aaf72c: "/nakama/data/modules/leaderboards.lua:182: error writing leaderboard record: sql: no rows in result set"
2021-11-03 17:22:25 ERROR | nakama | Error writing leaderboard recordsql: no rows in result set
2021-11-03 17:21:43 DEBUG | nakama | Leaderboard haystack lookup
2021-11-03 17:21:43 INFO | nakama | Wrote leaderboard character_level_warrior_standard for: 1fd68bb8-0ed5-41f9-89d4-27d010aaf72c
Description
When writing a leaderboard record for an authoritative leaderboard from a LUA-module, an error is sometimes thrown: "Error when writing leaderboard record: sql: no rows in result set"
Leaderboard settings (lua): authoritative = true sort = "desc" operator = "best" reset = nil
It seems to happen occasionally, I haven't found a pattern for when it fails, could be a timing issue. The lua module I'm using to write is simply a wrapper of the following call:
Steps to Reproduce
Expected Result
No error is thrown and the score is handled according to the "best" operator.
Actual Result
Context
Your Environment